/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('dyvmsapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddVirtualNumberRelationRequest {
  corpNameList?: string(name='CorpNameList', description='The company names. Separate multiple company names with commas (,).', example='Company 1'),
  numberList?: string(name='NumberList', description='The real numbers. Separate multiple real numbers with commas (,).

This parameter is required.', example='1321111****,1322222****'),
  ownerId?: long(name='OwnerId'),
  phoneNum?: string(name='PhoneNum', description='The virtual number.

This parameter is required.', example='05516214****'),
  prodCode?: string(name='ProdCode', description='The service name. Default value: **dyvms**.', example='dyvms'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routeType?: int32(name='RouteType', description='The route type. Valid values:

*   **0**: number location first.
*   **1**: random.

This parameter is required.', example='0'),
}

model AddVirtualNumberRelationResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value 200 indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='200'),
  data?: string(name='Data', description='The numbers that failed to be associated.

> If all numbers are associated, no value is returned for this parameter.', example='1321111****'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
}

model AddVirtualNumberRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddVirtualNumberRelationResponseBody(name='body'),
}

/**
 * @summary Adds the association relationship between a virtual number and real numbers in batches.
 *
 * @description ### QPS limits
 * You can call this operation up to 200 times per second per account.
 *
 * @param request AddVirtualNumberRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddVirtualNumberRelationResponse
 */
async function addVirtualNumberRelationWithOptions(request: AddVirtualNumberRelationRequest, runtime: Util.RuntimeOptions): AddVirtualNumberRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.corpNameList)) {
    query['CorpNameList'] = request.corpNameList;
  }
  if (!Util.isUnset(request.numberList)) {
    query['NumberList'] = request.numberList;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNum)) {
    query['PhoneNum'] = request.phoneNum;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routeType)) {
    query['RouteType'] = request.routeType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddVirtualNumberRelation',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds the association relationship between a virtual number and real numbers in batches.
 *
 * @description ### QPS limits
 * You can call this operation up to 200 times per second per account.
 *
 * @param request AddVirtualNumberRelationRequest
 * @return AddVirtualNumberRelationResponse
 */
async function addVirtualNumberRelation(request: AddVirtualNumberRelationRequest): AddVirtualNumberRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return addVirtualNumberRelationWithOptions(request, runtime);
}

model BatchRobotSmartCallRequest {
  calledNumber?: string(name='CalledNumber', description='The called number. Only mobile phone numbers in the Chinese mainland are supported.

You can set up to 1,000 called numbers and separate the numbers with commas (,).

This parameter is required.', example='1390000****'),
  calledShowNumber?: string(name='CalledShowNumber', description='The number displayed to called parties, which must be a number you purchased. You can view the numbers you purchased in the [Voice Messaging Service console](https://dyvms.console.aliyun.com/dyvms.htm#/number/normal).

You can set up to 100 numbers and separate the numbers with commas (,).

This parameter is required.', example='222'),
  corpName?: string(name='CorpName', description='The company name, which must be the same as the **company name** specified on the [qualification management page](https://dyvms.console.aliyun.com/dyvms.htm#/corp/normal).

> This parameter is optional if **isSelfLine** is set to **true**.', example='Alibaba'),
  dialogId?: string(name='DialogId', description='The ID of the robot or communication script that is used to initiate a call.

You can obtain the **communication script ID** from the [Communication script management](https://dyvms.console.aliyun.com/dyvms.htm#/smart-call/saas/robot/list) page.

This parameter is required.', example='1234567'),
  earlyMediaAsr?: boolean(name='EarlyMediaAsr', description='The speech recognition identifier of early media. The default value is **false**, which means that the speech recognition identifier of early media is not enabled.

Set the parameter to **true** if you want to enable the speech recognition identifier of early media.', example='true'),
  isSelfLine?: boolean(name='IsSelfLine', description='Specifies whether to call the self-managed line. Default value: **false**.', example='true'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scheduleCall?: boolean(name='ScheduleCall', description='Specifies whether the call is scheduled. If you set this parameter to **true**, the **ScheduleTime** parameter is required.', example='true'),
  scheduleTime?: long(name='ScheduleTime', description='The preset call time. This value is a UNIX timestamp. Unit: milliseconds.

>  This parameter is required only when **ScheduleCall** is set to **true**.', example='12'),
  taskName?: string(name='TaskName', description='The task name. The task name can be up to 30 characters in length.

This parameter is required.', example='Batch Tasks'),
  ttsParam?: string(name='TtsParam', description='The variable value of the TTS template, in the JSON format.

The variable value must correspond to a number. The TtsParam parameter must be used together with the TtsParamHead parameter.', example='[{"number":"1390000****","params":[“Miss li”,"miss wang","Mr.li"]}]'),
  ttsParamHead?: string(name='TtsParamHead', description='The call tasks with variables, in the JSON format.

The parameter value is a list of variable names. The TtsParamHead parameter must be used together with the TtsParam parameter.', example='["name1","name2","name3"]'),
}

model BatchRobotSmartCallResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  taskId?: string(name='TaskId', description='The unique ID of the robocall task. You can call the [QueryCallDetailByTaskId](https://help.aliyun.com/document_detail/393537.html) operation to query the details of the task based on the task ID.', example='4001112222'),
}

model BatchRobotSmartCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchRobotSmartCallResponseBody(name='body'),
}

/**
 * @summary Initiates an outbound robocall task.
 *
 * @description *   In an intelligent speech interaction task, you can use the robot communication scripts preset in the Voice Messaging Service console, or invoke the callback function to return the response mode configured by the business party in each call.
 * *   The BatchRobotSmartCall operation is used to initiate an outbound robocall task by using the robot communication scripts preset in the Voice Messaging Service console.
 * ## Prerequisites
 * *   You have passed the real-name verification for an enterprise user and passed the enterprise qualification review.
 * *   You have purchased numbers in the [Voice Messaging Service console](https://dyvms.console.aliyun.com/dyvms.htm#/number/normal).
 * *   You have added communication scripts on the [Communication script management](https://dyvms.console.aliyun.com/dyvms.htm#/smart-call/saas/robot/list) page, and the communication scripts have been approved.
 * > Before you call this operation, make sure that you are familiar with the [billing](https://www.aliyun.com/price/product#/vms/detail) of Voice Messaging Service (VMS).
 *
 * @param request BatchRobotSmartCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchRobotSmartCallResponse
 */
async function batchRobotSmartCallWithOptions(request: BatchRobotSmartCallRequest, runtime: Util.RuntimeOptions): BatchRobotSmartCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.corpName)) {
    query['CorpName'] = request.corpName;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  if (!Util.isUnset(request.earlyMediaAsr)) {
    query['EarlyMediaAsr'] = request.earlyMediaAsr;
  }
  if (!Util.isUnset(request.isSelfLine)) {
    query['IsSelfLine'] = request.isSelfLine;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scheduleCall)) {
    query['ScheduleCall'] = request.scheduleCall;
  }
  if (!Util.isUnset(request.scheduleTime)) {
    query['ScheduleTime'] = request.scheduleTime;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.ttsParam)) {
    query['TtsParam'] = request.ttsParam;
  }
  if (!Util.isUnset(request.ttsParamHead)) {
    query['TtsParamHead'] = request.ttsParamHead;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchRobotSmartCall',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Initiates an outbound robocall task.
 *
 * @description *   In an intelligent speech interaction task, you can use the robot communication scripts preset in the Voice Messaging Service console, or invoke the callback function to return the response mode configured by the business party in each call.
 * *   The BatchRobotSmartCall operation is used to initiate an outbound robocall task by using the robot communication scripts preset in the Voice Messaging Service console.
 * ## Prerequisites
 * *   You have passed the real-name verification for an enterprise user and passed the enterprise qualification review.
 * *   You have purchased numbers in the [Voice Messaging Service console](https://dyvms.console.aliyun.com/dyvms.htm#/number/normal).
 * *   You have added communication scripts on the [Communication script management](https://dyvms.console.aliyun.com/dyvms.htm#/smart-call/saas/robot/list) page, and the communication scripts have been approved.
 * > Before you call this operation, make sure that you are familiar with the [billing](https://www.aliyun.com/price/product#/vms/detail) of Voice Messaging Service (VMS).
 *
 * @param request BatchRobotSmartCallRequest
 * @return BatchRobotSmartCallResponse
 */
async function batchRobotSmartCall(request: BatchRobotSmartCallRequest): BatchRobotSmartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchRobotSmartCallWithOptions(request, runtime);
}

model CancelOrderRobotTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='The unique ID of the robocall task. You can call the [CreateRobotTask](https://help.aliyun.com/document_detail/393531.html) operation to obtain the ID of the robocall task.

This parameter is required.', example='1045001'),
}

model CancelOrderRobotTaskResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model CancelOrderRobotTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelOrderRobotTaskResponseBody(name='body'),
}

/**
 * @summary Cancels a robocall task that has not been started.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request CancelOrderRobotTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelOrderRobotTaskResponse
 */
async function cancelOrderRobotTaskWithOptions(request: CancelOrderRobotTaskRequest, runtime: Util.RuntimeOptions): CancelOrderRobotTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelOrderRobotTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Cancels a robocall task that has not been started.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request CancelOrderRobotTaskRequest
 * @return CancelOrderRobotTaskResponse
 */
async function cancelOrderRobotTask(request: CancelOrderRobotTaskRequest): CancelOrderRobotTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelOrderRobotTaskWithOptions(request, runtime);
}

model CancelRobotTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='The unique ID of the robocall task. You can call the [CreateRobotTask](https://help.aliyun.com/document_detail/393531.html) operation to obtain the task ID.', example='1045001'),
}

model CancelRobotTaskResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model CancelRobotTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelRobotTaskResponseBody(name='body'),
}

/**
 * @summary Terminates a robocall task.
 *
 * @description Only a task in progress can be terminated by calling the CancelRobotTask operation, and the task cannot be resumed after it is terminated.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request CancelRobotTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelRobotTaskResponse
 */
async function cancelRobotTaskWithOptions(request: CancelRobotTaskRequest, runtime: Util.RuntimeOptions): CancelRobotTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelRobotTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminates a robocall task.
 *
 * @description Only a task in progress can be terminated by calling the CancelRobotTask operation, and the task cannot be resumed after it is terminated.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request CancelRobotTaskRequest
 * @return CancelRobotTaskResponse
 */
async function cancelRobotTask(request: CancelRobotTaskRequest): CancelRobotTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelRobotTaskWithOptions(request, runtime);
}

model ChangeMediaTypeRequest {
  callId?: string(name='CallId', example='示例值示例值示例值'),
  calledNum?: string(name='CalledNum', description='This parameter is required.', example='示例值示例值'),
  mediaType?: string(name='MediaType', example='示例值示例值'),
  outId?: string(name='OutId', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ChangeMediaTypeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='示例值示例值'),
  message?: string(name='Message', example='示例值'),
  model?: boolean(name='Model', example='false'),
  success?: boolean(name='Success', example='true'),
}

model ChangeMediaTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeMediaTypeResponseBody(name='body'),
}

/**
 * @summary ChangeMediaType
 *
 * @param request ChangeMediaTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeMediaTypeResponse
 */
async function changeMediaTypeWithOptions(request: ChangeMediaTypeRequest, runtime: Util.RuntimeOptions): ChangeMediaTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNum)) {
    query['CalledNum'] = request.calledNum;
  }
  if (!Util.isUnset(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeMediaType',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary ChangeMediaType
 *
 * @param request ChangeMediaTypeRequest
 * @return ChangeMediaTypeResponse
 */
async function changeMediaType(request: ChangeMediaTypeRequest): ChangeMediaTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeMediaTypeWithOptions(request, runtime);
}

model CreateCallTaskRequest {
  bizType?: string(name='BizType', description='The type of the task template. Valid values:

*   **VMS_VOICE_TTS**: the text-to-speech (TTS) notification template.
*   **VMS_VOICE_CODE**: the voice notification template.
*   **VMS_TTS**: the voice verification code template.', example='VMS_VOICE_TTS'),
  data?: string(name='Data', description='The called numbers.

*   If you set DataType to LIST, the value of Data is in the LIST format.
*   If you set DataType to JSON, the value of Data is in the JSON format.', example='{ "paramNames":["name1","name2","key3"], "calleeList":[ { "callee":"131222222", "params":["zangsan","zhangsan01","zhangsan02"] }, { "callee":"131222222", "params":["zangsan","zhangsan01","zhangsan02"] }, ] }'),
  dataType?: string(name='DataType', description='The type of called numbers. Valid values:

*   **LIST**: the called numbers that are separated by commas (,).
*   **JSON**: a JSON-formatted list of called numbers with template parameters.', example='JSON'),
  fireTime?: string(name='FireTime', description='This parameter is unavailable.', example='1'),
  ownerId?: long(name='OwnerId'),
  resource?: string(name='Resource', description='The calling number. Only virtual numbers are supported.', example='05516214****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The type of the calling number. Set the value to **LIST**.', example='LIST'),
  scheduleType?: string(name='ScheduleType', description='This parameter is unavailable.', example='1'),
  stopTime?: string(name='StopTime', description='This parameter is unavailable.', example='1'),
  taskName?: string(name='TaskName', description='The task name.', example='Aliyun'),
  templateCode?: string(name='TemplateCode', description='The template ID.', example='TTS_2122****'),
  templateName?: string(name='TemplateName', description='The template name.', example='Test Template'),
}

model CreateCallTaskResponseBody = {
  code?: string(name='Code', description='The response code.', example='200'),
  data?: long(name='Data', description='The task ID.', example='123456'),
  requestId?: string(name='RequestId', description='The request ID.', example='ED815433-724A-4357-9991-A54AD2FF09FD'),
}

model CreateCallTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCallTaskResponseBody(name='body'),
}

/**
 * @summary Creates a task for sending voice notifications or voice verification codes.
 *
 * @description You can create up to 1,000 voice notifications for each task.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request CreateCallTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCallTaskResponse
 */
async function createCallTaskWithOptions(request: CreateCallTaskRequest, runtime: Util.RuntimeOptions): CreateCallTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.fireTime)) {
    query['FireTime'] = request.fireTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resource)) {
    query['Resource'] = request.resource;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.scheduleType)) {
    query['ScheduleType'] = request.scheduleType;
  }
  if (!Util.isUnset(request.stopTime)) {
    query['StopTime'] = request.stopTime;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.templateCode)) {
    query['TemplateCode'] = request.templateCode;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCallTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a task for sending voice notifications or voice verification codes.
 *
 * @description You can create up to 1,000 voice notifications for each task.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request CreateCallTaskRequest
 * @return CreateCallTaskResponse
 */
async function createCallTask(request: CreateCallTaskRequest): CreateCallTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCallTaskWithOptions(request, runtime);
}

model CreateRobotTaskRequest {
  caller?: string(name='Caller', description='The calling number.

You must use the phone numbers that you have purchased and separate multiple numbers with commas (,). You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home) and choose **Real Number Service** > **Real Number Management** to view the numbers you purchased.

This parameter is required.', example='0571****5678'),
  corpName?: string(name='CorpName', description='The company name, which must be the same as the **enterprise name** on the qualification management page.', example='Alibaba'),
  dialogId?: long(name='DialogId', description='The ID of the robot or communication script that is used to initiate the call.

You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home) and choose **Intelligent Voice Robot** > **Communication Script Management** to view the communication script ID.

This parameter is required.', example='1000023****'),
  isSelfLine?: boolean(name='IsSelfLine', description='Specifies whether to call the self-managed line. Valid values:

*   **false** (default)
*   **true**

> If you set this parameter to **true**, calling numbers are not verified.', example='false'),
  numberStatusIdent?: boolean(name='NumberStatusIdent', description='Specifies whether to enable number status identification. Valid values:

*   **false** (default)
*   **true**

> If you set this parameter to **true**, the reason why a call is not answered is recorded.

This parameter is required.', example='true'),
  ownerId?: long(name='OwnerId'),
  recallInterval?: int32(name='RecallInterval', description='The redial interval. Unit: minutes. The value must be greater than 1.

> The maximum redial interval is 30 minutes.', example='5'),
  recallStateCodes?: string(name='RecallStateCodes', description='The call state in which redial is required. Separate multiple call states with commas (,). Valid values:

*   **200010**: The phone of the called party is powered off.
*   **200011**: The number of the called party is out of service.
*   **200002**: The line is busy.
*   **200012**: The call is lost.
*   **200005**: The called party cannot be connected.
*   **200003**: The called party does not respond to the call.', example='200010,200011'),
  recallTimes?: int32(name='RecallTimes', description='The number of redial times.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  retryType?: int32(name='RetryType', description='Specifies whether to enable auto-redial. Valid values:

*   **1**: enables auto-redial.
*   **0**: disables auto-redial.

This parameter is required.', example='1'),
  taskName?: string(name='TaskName', description='The task name. The task name can be up to 30 characters in length.

This parameter is required.', example='Test Template'),
}

model CreateRobotTaskResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The unique ID of the robocall task.

You can call the [QueryRobotTaskDetail](https://help.aliyun.com/document_detail/393538.html) operation to query the details of the task based on the task ID.', example='400111****'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model CreateRobotTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRobotTaskResponseBody(name='body'),
}

/**
 * @summary Initiates an outbound robocall task.
 *
 * @description You can call this operation to initiate an outbound robocall task by using the robot communication scripts preset in the Voice Messaging Service console. In an intelligent speech interaction task, you can use the robot communication scripts preset in the Voice Messaging Service console, or invoke the callback function to return the response mode configured by the business party in each call.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request CreateRobotTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRobotTaskResponse
 */
async function createRobotTaskWithOptions(request: CreateRobotTaskRequest, runtime: Util.RuntimeOptions): CreateRobotTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.caller)) {
    query['Caller'] = request.caller;
  }
  if (!Util.isUnset(request.corpName)) {
    query['CorpName'] = request.corpName;
  }
  if (!Util.isUnset(request.dialogId)) {
    query['DialogId'] = request.dialogId;
  }
  if (!Util.isUnset(request.isSelfLine)) {
    query['IsSelfLine'] = request.isSelfLine;
  }
  if (!Util.isUnset(request.numberStatusIdent)) {
    query['NumberStatusIdent'] = request.numberStatusIdent;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.recallInterval)) {
    query['RecallInterval'] = request.recallInterval;
  }
  if (!Util.isUnset(request.recallStateCodes)) {
    query['RecallStateCodes'] = request.recallStateCodes;
  }
  if (!Util.isUnset(request.recallTimes)) {
    query['RecallTimes'] = request.recallTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.retryType)) {
    query['RetryType'] = request.retryType;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRobotTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Initiates an outbound robocall task.
 *
 * @description You can call this operation to initiate an outbound robocall task by using the robot communication scripts preset in the Voice Messaging Service console. In an intelligent speech interaction task, you can use the robot communication scripts preset in the Voice Messaging Service console, or invoke the callback function to return the response mode configured by the business party in each call.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request CreateRobotTaskRequest
 * @return CreateRobotTaskResponse
 */
async function createRobotTask(request: CreateRobotTaskRequest): CreateRobotTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRobotTaskWithOptions(request, runtime);
}

model DegradeVideoFileRequest {
  callId?: string(name='CallId', example='116012354148^1028137841****'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='1590****000'),
  mediaType?: string(name='MediaType', example='video'),
  outId?: string(name='OutId', example='225869*****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DegradeVideoFileResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='示例值'),
  success?: boolean(name='Success', example='true'),
}

model DegradeVideoFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DegradeVideoFileResponseBody(name='body'),
}

/**
 * @summary DegradeVideoFile
 *
 * @param request DegradeVideoFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DegradeVideoFileResponse
 */
async function degradeVideoFileWithOptions(request: DegradeVideoFileRequest, runtime: Util.RuntimeOptions): DegradeVideoFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DegradeVideoFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary DegradeVideoFile
 *
 * @param request DegradeVideoFileRequest
 * @return DegradeVideoFileResponse
 */
async function degradeVideoFile(request: DegradeVideoFileRequest): DegradeVideoFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return degradeVideoFileWithOptions(request, runtime);
}

model DeleteRobotTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='The unique ID of the robocall task. You can call the [CreateRobotTask](~~CreateRobotTask~~) operation to obtain the task ID.

This parameter is required.', example='1045001'),
}

model DeleteRobotTaskResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model DeleteRobotTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRobotTaskResponseBody(name='body'),
}

/**
 * @summary Deletes a robocall task.
 *
 * @description You can call this operation to delete only tasks that are not started, that are completed, and that are terminated.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteRobotTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRobotTaskResponse
 */
async function deleteRobotTaskWithOptions(request: DeleteRobotTaskRequest, runtime: Util.RuntimeOptions): DeleteRobotTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRobotTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a robocall task.
 *
 * @description You can call this operation to delete only tasks that are not started, that are completed, and that are terminated.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteRobotTaskRequest
 * @return DeleteRobotTaskResponse
 */
async function deleteRobotTask(request: DeleteRobotTaskRequest): DeleteRobotTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRobotTaskWithOptions(request, runtime);
}

model ExecuteCallTaskRequest {
  fireTime?: string(name='FireTime', description='The time when the call task is executed, in the yyyy-MM-dd HH:mm:ss format.

> You can leave this parameter empty.', example='2021-03-09 00:00:00'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', description='The task state. Valid values:

*   **RUNNING**
*   **STOP**
*   **CANCEL**

This parameter is required.', example='RUNNING'),
  taskId?: long(name='TaskId', description='The task ID. You can call the [CreateCallTask](~~CreateCallTask~~) operation to obtain the task ID.

This parameter is required.', example='2256****'),
}

model ExecuteCallTaskResponseBody = {
  code?: string(name='Code', description='The response code.', example='200'),
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='53D0F0Fe-cbbB-De28-6FCd-DdbBcefA46dD'),
}

model ExecuteCallTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteCallTaskResponseBody(name='body'),
}

/**
 * @summary Executes a call task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ExecuteCallTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteCallTaskResponse
 */
async function executeCallTaskWithOptions(request: ExecuteCallTaskRequest, runtime: Util.RuntimeOptions): ExecuteCallTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fireTime)) {
    query['FireTime'] = request.fireTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteCallTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Executes a call task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ExecuteCallTaskRequest
 * @return ExecuteCallTaskResponse
 */
async function executeCallTask(request: ExecuteCallTaskRequest): ExecuteCallTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeCallTaskWithOptions(request, runtime);
}

model GetCallMediaTypeRequest {
  callId?: string(name='CallId', example='116012854210^10281427****'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='1580000****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetCallMediaTypeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='示例值示例值示例值'),
  success?: boolean(name='Success', example='true'),
}

model GetCallMediaTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCallMediaTypeResponseBody(name='body'),
}

/**
 * @summary GetCallMediaType
 *
 * @param request GetCallMediaTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCallMediaTypeResponse
 */
async function getCallMediaTypeWithOptions(request: GetCallMediaTypeRequest, runtime: Util.RuntimeOptions): GetCallMediaTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCallMediaType',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary GetCallMediaType
 *
 * @param request GetCallMediaTypeRequest
 * @return GetCallMediaTypeResponse
 */
async function getCallMediaType(request: GetCallMediaTypeRequest): GetCallMediaTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCallMediaTypeWithOptions(request, runtime);
}

model GetCallProgressRequest {
  callId?: string(name='CallId', example='示例值'),
  calledNum?: string(name='CalledNum', description='This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetCallProgressResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='示例值示例值'),
  message?: string(name='Message', example='示例值示例值'),
  model?: map[string]any(name='Model'),
  success?: boolean(name='Success', example='false'),
}

model GetCallProgressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCallProgressResponseBody(name='body'),
}

/**
 * @summary GetCallProgress
 *
 * @param request GetCallProgressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCallProgressResponse
 */
async function getCallProgressWithOptions(request: GetCallProgressRequest, runtime: Util.RuntimeOptions): GetCallProgressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNum)) {
    query['CalledNum'] = request.calledNum;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCallProgress',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary GetCallProgress
 *
 * @param request GetCallProgressRequest
 * @return GetCallProgressResponse
 */
async function getCallProgress(request: GetCallProgressRequest): GetCallProgressResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCallProgressWithOptions(request, runtime);
}

model GetHotlineQualificationByOrderRequest {
  orderId?: string(name='OrderId', description='The ticket ID.

You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Qualification\\\\&Communication Script Management** > **Qualification Management**, and then click the **400 Qualifications** tab to view the ticket ID.

This parameter is required.', example='22456****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetHotlineQualificationByOrderResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: {
    orderId?: string(name='OrderId', description='The ID of the qualification application ticket.', example='22456****'),
    qualificationId?: string(name='QualificationId', description='The qualification ID.', example='1478*****'),
    status?: string(name='Status', description='The qualification state. Valid values:

*   **NORMAL**
*   **OTHER**', example='NORMAL'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='6086693B-2250-17CE-A41F-06259AB6DB1B'),
}

model GetHotlineQualificationByOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotlineQualificationByOrderResponseBody(name='body'),
}

/**
 * @summary Obtains the qualification ID based on the ID of a qualification application ticket.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request GetHotlineQualificationByOrderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotlineQualificationByOrderResponse
 */
async function getHotlineQualificationByOrderWithOptions(request: GetHotlineQualificationByOrderRequest, runtime: Util.RuntimeOptions): GetHotlineQualificationByOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHotlineQualificationByOrder',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the qualification ID based on the ID of a qualification application ticket.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request GetHotlineQualificationByOrderRequest
 * @return GetHotlineQualificationByOrderResponse
 */
async function getHotlineQualificationByOrder(request: GetHotlineQualificationByOrderRequest): GetHotlineQualificationByOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineQualificationByOrderWithOptions(request, runtime);
}

model GetTemporaryFileUrlRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  videoId?: string(name='VideoId', description='This parameter is required.', example='45a04670582571eebf9e4531948c****'),
}

model GetTemporaryFileUrlResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='示例值'),
  requestId?: string(name='RequestId', example='7BF47617-7851-48F7-A3A1-2021342A****'),
  success?: boolean(name='Success', example='true'),
}

model GetTemporaryFileUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTemporaryFileUrlResponseBody(name='body'),
}

/**
 * @summary GetTemporaryFileUrl
 *
 * @param request GetTemporaryFileUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTemporaryFileUrlResponse
 */
async function getTemporaryFileUrlWithOptions(request: GetTemporaryFileUrlRequest, runtime: Util.RuntimeOptions): GetTemporaryFileUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTemporaryFileUrl',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary GetTemporaryFileUrl
 *
 * @param request GetTemporaryFileUrlRequest
 * @return GetTemporaryFileUrlResponse
 */
async function getTemporaryFileUrl(request: GetTemporaryFileUrlRequest): GetTemporaryFileUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTemporaryFileUrlWithOptions(request, runtime);
}

model GetTokenRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tokenType?: string(name='TokenType', description='The token type.', example='dyvms'),
}

model GetTokenResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69DDD'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
  token?: string(name='Token', description='The token.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc190ZXN0In0.eyJqdGkiOiJUTjhfRzFCaEpETTJ3LWVoeGJZZXRnIiwiaWF0IjoxNjIzMzk0NTI3LCJleHAiOjE2MjMzOTYzMjcsIm5iZi****'),
}

model GetTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTokenResponseBody(name='body'),
}

/**
 * @summary Obtains the token for authentication.
 *
 * @description ### QPS limits
 * You can call this operation up to five times per second per account.
 *
 * @param request GetTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTokenResponse
 */
async function getTokenWithOptions(request: GetTokenRequest, runtime: Util.RuntimeOptions): GetTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tokenType)) {
    query['TokenType'] = request.tokenType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetToken',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the token for authentication.
 *
 * @description ### QPS limits
 * You can call this operation up to five times per second per account.
 *
 * @param request GetTokenRequest
 * @return GetTokenResponse
 */
async function getToken(request: GetTokenRequest): GetTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTokenWithOptions(request, runtime);
}

model GetVideoFieldUrlRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  videoFile?: string(name='VideoFile', example='示例值示例值'),
}

model GetVideoFieldUrlResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='示例值示例值'),
  message?: string(name='Message', example='示例值示例值'),
  model?: map[string]any(name='Model'),
  success?: boolean(name='Success', example='false'),
}

model GetVideoFieldUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoFieldUrlResponseBody(name='body'),
}

/**
 * @summary GetVideoFieldUrl
 *
 * @param request GetVideoFieldUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVideoFieldUrlResponse
 */
async function getVideoFieldUrlWithOptions(request: GetVideoFieldUrlRequest, runtime: Util.RuntimeOptions): GetVideoFieldUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.videoFile)) {
    query['VideoFile'] = request.videoFile;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetVideoFieldUrl',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary GetVideoFieldUrl
 *
 * @param request GetVideoFieldUrlRequest
 * @return GetVideoFieldUrlResponse
 */
async function getVideoFieldUrl(request: GetVideoFieldUrlRequest): GetVideoFieldUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getVideoFieldUrlWithOptions(request, runtime);
}

model IvrCallRequest {
  byeCode?: string(name='ByeCode', description='The end voice.

*   If you use a voice notification file, this parameter specifies the voice ID. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice Messages** > **Voice Notifications**, and then click the **Voice Notification Files** tab to view the voice ID.
*   If you use a TTS template, this parameter specifies the template ID. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice Messages** > **Voice Notifications**, and then click the **TTS Template** tab to view the template ID.

> The value of the ByeCode parameter must be of the same type as the value of the StartCode parameter. This means that both parameters must specify voice IDs or TTS template IDs.', example='TTS_1234****'),
  byeTtsParams?: string(name='ByeTtsParams', description='The variables in the TTS template, in the JSON format.

> This parameter is required when the ByeCode parameter is set to the ID of a TTS template that contains variables.', example='{"name":"xxx","code":"123"}'),
  calledNumber?: string(name='CalledNumber', description='The called number.

Only phone numbers in the Chinese mainland are supported. Each request supports only one called number.

This parameter is required.', example='1590****000'),
  calledShowNumber?: string(name='CalledShowNumber', description='The calling number.

The value must be a number you purchased. Each request supports only one calling number. In most cases, a calling number is configured with the maximum number of concurrent requests. New requests fail if the maximum number of concurrent requests is reached. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home) and choose **Real Number Service > Real Number Management** to view the number you purchased.

This parameter is required.', example='0571****5678'),
  menuKeyMap?: [ 
    {
      code?: string(name='Code', description='The voice that corresponds to the key specified by the **MenuKeyMap.N.Key** parameter.

*   If you use a voice notification file, this parameter specifies the voice ID. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice Messages** > **Voice Notifications**, and then click the **Voice Notification Files** tab to view the voice ID.
*   If you use a TTS template, this parameter specifies the template ID. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice Messages** > **Voice Notifications**, and then click the **TTS Template** tab to view the template ID.', example='TTS_1235****'),
      key?: string(name='Key', description='The key that can be pressed by the subscriber.', example='1'),
      ttsParams?: string(name='TtsParams', description='The variables in the TTS template, in the JSON format.

> 

*   This parameter specifies the substitution relationship of the variables in the TTS template if the value of the **MenuKeyMap.N.Code** parameter is set to the ID of the TTS template.

*   This parameter is required if the value of the **MenuKeyMap.N.Code** parameter is set to the ID of a TTS template that contains variables.', example='{"name":"xxx","code":"123"}'),
    }
  ](name='MenuKeyMap', description='The information about the key pressed by the subscriber.'),
  outId?: string(name='OutId', description='The ID that is reserved for the caller of the operation. This ID is returned to the caller in a receipt message.

The value is of the STRING type and must be 1 to 15 bytes in length.', example='PR0210428****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: long(name='PlayTimes', description='The number of replay times. Valid values: 1 to 3.', example='3'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startCode?: string(name='StartCode', description='The voice that is played when the call begins.

*   If you use a voice notification file, this parameter specifies the voice ID. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice Messages** > Voice Notifications, and then click the **Voice Notification Files** tab to view the voice ID.
*   If you use a text-to-speech (TTS) template, this parameter specifies the template ID. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice Messages** > **Voice Notifications**, and then click the **TTS Template** tab to view the template ID.

This parameter is required.', example='TTS_1234****'),
  startTtsParams?: string(name='StartTtsParams', description='The variables in the TTS template, in the JSON format.

> This parameter is required when the StartCode parameter is set to the ID of a TTS template that contains variables.', example='{"name":"xxx","code":"123"}'),
  timeout?: int32(name='Timeout', description='The timeout period for the subscriber to press a key. Unit: milliseconds.', example='3000'),
}

model IvrCallResponseBody = {
  callId?: string(name='CallId', description='The unique receipt ID of the call.

You can call the [QueryCallDetailByCallId](https://help.aliyun.com/document_detail/393529.html) operation to query the details of the call based on the receipt ID.', example='116012354148^10281378****'),
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model IvrCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: IvrCallResponseBody(name='body'),
}

/**
 * @summary Initiates an interactive voice response (IVR) call to a specified number.
 *
 * @description *   Your enterprise qualification is approved. For more information, see [Submit enterprise qualifications](https://help.aliyun.com/document_detail/149795.html).
 * *   Voice numbers are purchased. For more information, see [Purchase numbers](https://help.aliyun.com/document_detail/149794.html).
 * *   When the subscriber answers the call, the subscriber hears a voice that instructs the subscriber to press a key as needed. If the [message receipt](https://help.aliyun.com/document_detail/112503.html) feature is enabled, the Voice Messaging Service (VMS) platform returns the information about the key pressed by the subscriber to the business system. The key information includes the order confirmation, questionnaire survey, and satisfaction survey completed by the subscriber.
 * ## QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request IvrCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return IvrCallResponse
 */
async function ivrCallWithOptions(request: IvrCallRequest, runtime: Util.RuntimeOptions): IvrCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.byeCode)) {
    query['ByeCode'] = request.byeCode;
  }
  if (!Util.isUnset(request.byeTtsParams)) {
    query['ByeTtsParams'] = request.byeTtsParams;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.menuKeyMap)) {
    query['MenuKeyMap'] = request.menuKeyMap;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startCode)) {
    query['StartCode'] = request.startCode;
  }
  if (!Util.isUnset(request.startTtsParams)) {
    query['StartTtsParams'] = request.startTtsParams;
  }
  if (!Util.isUnset(request.timeout)) {
    query['Timeout'] = request.timeout;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'IvrCall',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Initiates an interactive voice response (IVR) call to a specified number.
 *
 * @description *   Your enterprise qualification is approved. For more information, see [Submit enterprise qualifications](https://help.aliyun.com/document_detail/149795.html).
 * *   Voice numbers are purchased. For more information, see [Purchase numbers](https://help.aliyun.com/document_detail/149794.html).
 * *   When the subscriber answers the call, the subscriber hears a voice that instructs the subscriber to press a key as needed. If the [message receipt](https://help.aliyun.com/document_detail/112503.html) feature is enabled, the Voice Messaging Service (VMS) platform returns the information about the key pressed by the subscriber to the business system. The key information includes the order confirmation, questionnaire survey, and satisfaction survey completed by the subscriber.
 * ## QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request IvrCallRequest
 * @return IvrCallResponse
 */
async function ivrCall(request: IvrCallRequest): IvrCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return ivrCallWithOptions(request, runtime);
}

model ListCallTaskRequest {
  bizType?: string(name='BizType', description='The type of the task template. Valid values:

*   **VMS_VOICE_TTS**: the text-to-speech (TTS) notification template.
*   **VMS_VOICE_CODE**: the voice notification template.
*   **VMS_TTS**: the voice verification code template.', example='VMS_VOICE_CODE'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: **10**.', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', description='The task state. Valid values:

*   **INIT**: The task is in the initial state.
*   **RELEASE**: The task is being parsed.
*   **RUNNING**: The task is running.
*   **STOP**: The task is suspended.
*   **SYSTEM_STOP**: The task is suspended by the system.
*   **CANCEL**: The task is canceled.
*   **SYSTEM_CANCEL**: The task is canceled by the system.
*   **DONE**: The task is complete.', example='DONE'),
  taskId?: string(name='TaskId', description='The task ID.', example='151001****'),
  taskName?: string(name='TaskName', description='The task name.', example='Aliyun'),
  templateName?: string(name='TemplateName', description='The template name.', example='Test Template'),
}

model ListCallTaskResponseBody = {
  code?: string(name='Code', description='The response code.', example='200'),
  data?: [ 
    {
      bizType?: string(name='BizType', description='The type of the task template. Valid values:

*   **VMS_VOICE_TTS**: the TTS notification template.
*   **VMS_VOICE_CODE**: the voice notification template.
*   **VMS_TTS**: the voice verification code template.', example='VMS_VOICE_TTS'),
      completeTime?: string(name='CompleteTime', description='The time when the task was completed. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1614330986000'),
      completedCount?: long(name='CompletedCount', description='The number of tasks that were complete.', example='2'),
      completedRate?: int32(name='CompletedRate', description='The task progress.', example='26%'),
      data?: string(name='Data', description='This parameter is unavailable.', example='1'),
      dataType?: string(name='DataType', description='The type of the called number.', example='LIST'),
      fireTime?: string(name='FireTime', description='The time when the scheduled task was started. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1614330978000'),
      id?: long(name='Id', description='The task ID.', example='123879546214'),
      resource?: string(name='Resource', description='The calling number.', example='0571000****'),
      status?: string(name='Status', description='The task state. Valid values:

*   **INIT**: The task was in the initial state.
*   **RELEASE**: The task was being parsed.
*   **RUNNING**: The task was running.
*   **STOP**: The task was manually suspended.
*   **SYSTEM_STOP**: The task was suspended by the system.
*   **CANCEL**: The task was manually canceled.
*   **SYSTEM_CANCEL**: The task was canceled by the system.
*   **DONE**: The task was complete.', example='DONE'),
      stopTime?: string(name='StopTime', description='This parameter is unavailable.', example='1'),
      taskName?: string(name='TaskName', description='The task name.', example='Aliyun'),
      templateCode?: string(name='TemplateCode', description='The ID of the voice template.', example='TTS_2100****'),
      templateName?: string(name='TemplateName', description='The template name.', example='Test Template'),
      totalCount?: long(name='TotalCount', description='The total number of called numbers.', example='600'),
    }
  ](name='Data', description='The task information.'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='2'),
  requestId?: string(name='RequestId', description='The request ID.', example='5B0F201F-DCDA-45C2-AA92-1AE177F94991'),
  total?: long(name='Total', description='The total number of tasks.', example='10'),
}

model ListCallTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCallTaskResponseBody(name='body'),
}

/**
 * @summary Queries task information.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ListCallTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCallTaskResponse
 */
async function listCallTaskWithOptions(request: ListCallTaskRequest, runtime: Util.RuntimeOptions): ListCallTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCallTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries task information.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ListCallTaskRequest
 * @return ListCallTaskResponse
 */
async function listCallTask(request: ListCallTaskRequest): ListCallTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCallTaskWithOptions(request, runtime);
}

model ListCallTaskDetailRequest {
  calledNum?: string(name='CalledNum', description='The called number.', example='1300000****'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: **10**.', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', description='The task state. Valid values:

*   **SUCCESS**: The task is successful.
*   **FAIL**: The task fails.
*   **INIT**: The task is not started.', example='SUCCESS'),
  taskId?: long(name='TaskId', description='The task ID.

This parameter is required.', example='150001****'),
}

model ListCallTaskDetailResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: [ 
    {
      calledNum?: string(name='CalledNum', description='The called number.', example='1300000****'),
      caller?: string(name='Caller', description='The calling number.', example='0571000****'),
      duration?: long(name='Duration', description='The call duration. Unit: seconds.', example='200'),
      id?: long(name='Id', description='This parameter is unavailable.', example='1'),
      status?: string(name='Status', description='The task state. Valid values:

*   **SUCCESS**: The task was successful.
*   **FAIL**: The task failed.
*   **INIT**: The task was not started.', example='FAIL'),
    }
  ](name='Data', description='The information about the task.'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='D692AC3D-CBA8-417F-BEB9-5B73718922D4'),
  total?: long(name='Total', description='The total number of called numbers.', example='1000'),
  totalPage?: long(name='TotalPage', description='The total number of pages.', example='1'),
}

model ListCallTaskDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCallTaskDetailResponseBody(name='body'),
}

/**
 * @summary Queries the information about a task based on the task ID.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ListCallTaskDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCallTaskDetailResponse
 */
async function listCallTaskDetailWithOptions(request: ListCallTaskDetailRequest, runtime: Util.RuntimeOptions): ListCallTaskDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNum)) {
    query['CalledNum'] = request.calledNum;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCallTaskDetail',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a task based on the task ID.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ListCallTaskDetailRequest
 * @return ListCallTaskDetailResponse
 */
async function listCallTaskDetail(request: ListCallTaskDetailRequest): ListCallTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCallTaskDetailWithOptions(request, runtime);
}

model ListHotlineTransferNumberRequest {
  hotlineNumber?: string(name='HotlineNumber', description='The China 400 number.

This parameter is required.', example='400****'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 10.', example='10'),
  qualificationId?: string(name='QualificationId', description='The qualification ID. You can call the [GetHotlineQualificationByOrder](https://help.aliyun.com/document_detail/393548.html) operation to obtain the qualification ID.

This parameter is required.', example='100***'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ListHotlineTransferNumberResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: {
    pageNo?: int32(name='PageNo', description='The page number.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries per page.', example='20'),
    total?: long(name='Total', description='The total number of entries returned.', example='1'),
    values?: [ 
      {
        hotlineNumber?: string(name='HotlineNumber', description='The China 400 number.', example='400****'),
        identityCard?: string(name='IdentityCard', description='The ID card number of the number owner.', example='500***4119'),
        numberOwnerName?: string(name='NumberOwnerName', description='The real name of the number owner or the company name.', example='A***'),
        phoneNumber?: string(name='PhoneNumber', description='The registered phone number.', example='1580000****'),
        qualificationId?: string(name='QualificationId', description='The qualification ID.', example='100***'),
        resUniqueCode?: string(name='ResUniqueCode', description='The resource code.', example='1***'),
      }
    ](name='Values', description='The phone numbers.'),
  }(name='Data', description='The information about the registered phone number.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='6086693B-2250-17CE-A41F-06259AB6DB1B'),
}

model ListHotlineTransferNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotlineTransferNumberResponseBody(name='body'),
}

/**
 * @summary Queries a list of registered phone numbers that are used to transfer calls.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ListHotlineTransferNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotlineTransferNumberResponse
 */
async function listHotlineTransferNumberWithOptions(request: ListHotlineTransferNumberRequest, runtime: Util.RuntimeOptions): ListHotlineTransferNumberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.hotlineNumber)) {
    query['HotlineNumber'] = request.hotlineNumber;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.qualificationId)) {
    query['QualificationId'] = request.qualificationId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHotlineTransferNumber',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of registered phone numbers that are used to transfer calls.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ListHotlineTransferNumberRequest
 * @return ListHotlineTransferNumberResponse
 */
async function listHotlineTransferNumber(request: ListHotlineTransferNumberRequest): ListHotlineTransferNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHotlineTransferNumberWithOptions(request, runtime);
}

model ListHotlineTransferRegisterFileRequest {
  hotlineNumber?: string(name='HotlineNumber', description='The China 400 number.

This parameter is required.', example='400****'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 10.', example='10'),
  qualificationId?: string(name='QualificationId', description='The qualification ID. You can call the [GetHotlineQualificationByOrder](https://help.aliyun.com/document_detail/393548.html) operation to obtain the qualification ID.

This parameter is required.', example='1000****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ListHotlineTransferRegisterFileResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: {
    pageNo?: int32(name='PageNo', description='The page number.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
    total?: long(name='Total', description='The total number of entries returned.', example='1'),
    values?: [ 
      {
        agree?: string(name='Agree', description='The authenticity of the commitment.', example='true'),
        corpName?: string(name='CorpName', description='The enterprise name.', example='A**'),
        hotlineNumber?: string(name='HotlineNumber', description='The China 400 number.', example='400****'),
        mngOpIdentityCard?: string(name='MngOpIdentityCard', description='The ID card number of the handler.', example='5****************9'),
        mngOpMail?: string(name='MngOpMail', description='The email address of the handler.', example='username@example.com'),
        mngOpMobile?: string(name='MngOpMobile', description='The mobile phone number of the handler.', example='150****0000'),
        mngOpName?: string(name='MngOpName', description='The name of the handler.', example='A***'),
        qualificationId?: string(name='QualificationId', description='The qualification ID.', example='1234****'),
        resUniqueCode?: long(name='ResUniqueCode', description='The unique code of the query operation.', example='1'),
      }
    ](name='Values', description='The registration file.'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='6086693B-2250-17CE-A41F-06259AB6DB1B'),
}

model ListHotlineTransferRegisterFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotlineTransferRegisterFileResponseBody(name='body'),
}

/**
 * @summary Queries the registration information about a China 400 number.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ListHotlineTransferRegisterFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotlineTransferRegisterFileResponse
 */
async function listHotlineTransferRegisterFileWithOptions(request: ListHotlineTransferRegisterFileRequest, runtime: Util.RuntimeOptions): ListHotlineTransferRegisterFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.hotlineNumber)) {
    query['HotlineNumber'] = request.hotlineNumber;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.qualificationId)) {
    query['QualificationId'] = request.qualificationId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHotlineTransferRegisterFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the registration information about a China 400 number.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request ListHotlineTransferRegisterFileRequest
 * @return ListHotlineTransferRegisterFileResponse
 */
async function listHotlineTransferRegisterFile(request: ListHotlineTransferRegisterFileRequest): ListHotlineTransferRegisterFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHotlineTransferRegisterFileWithOptions(request, runtime);
}

model PauseVideoFileRequest {
  callId?: string(name='CallId', example='116012854210^10281427****'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PauseVideoFileResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='示例值示例值示例值'),
  success?: boolean(name='Success', example='true'),
}

model PauseVideoFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PauseVideoFileResponseBody(name='body'),
}

/**
 * @summary PauseVideoFile
 *
 * @param request PauseVideoFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PauseVideoFileResponse
 */
async function pauseVideoFileWithOptions(request: PauseVideoFileRequest, runtime: Util.RuntimeOptions): PauseVideoFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PauseVideoFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary PauseVideoFile
 *
 * @param request PauseVideoFileRequest
 * @return PauseVideoFileResponse
 */
async function pauseVideoFile(request: PauseVideoFileRequest): PauseVideoFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return pauseVideoFileWithOptions(request, runtime);
}

model PlayVideoFileRequest {
  callId?: string(name='CallId', example='116012354148^1028137841****'),
  calledNumber?: string(name='CalledNumber', example='示例值'),
  onlyPhone?: boolean(name='OnlyPhone', example='false'),
  outId?: string(name='OutId', example='342268*****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  videoId?: string(name='VideoId', description='This parameter is required.', example='示例值示例值示例值'),
}

model PlayVideoFileResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='示例值示例值'),
  model?: boolean(name='Model', example='false'),
  success?: boolean(name='Success', example='true'),
}

model PlayVideoFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PlayVideoFileResponseBody(name='body'),
}

/**
 * @summary PlayVideoFile
 *
 * @param request PlayVideoFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PlayVideoFileResponse
 */
async function playVideoFileWithOptions(request: PlayVideoFileRequest, runtime: Util.RuntimeOptions): PlayVideoFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.onlyPhone)) {
    query['OnlyPhone'] = request.onlyPhone;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PlayVideoFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary PlayVideoFile
 *
 * @param request PlayVideoFileRequest
 * @return PlayVideoFileResponse
 */
async function playVideoFile(request: PlayVideoFileRequest): PlayVideoFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return playVideoFileWithOptions(request, runtime);
}

model QueryCallDetailByCallIdRequest {
  callId?: string(name='CallId', description='The unique ID of the call.

> 

*   The CallId parameter is included in the response parameters of the outbound call operation that you call to initiate a call.

*   The date when the call specified by CallId is started must be the same as the date specified by QueryDate.

*   The value of CallId must match the value of ProdId.

This parameter is required.', example='116014888060^10281631****'),
  ownerId?: long(name='OwnerId'),
  prodId?: long(name='ProdId', description='The service ID. Valid values:

*   **11000000300006**: voice notification. You can call the [SingleCallByVoice](https://help.aliyun.com/document_detail/393517.html) operation to send a voice notification of the voice notification file type to the specified number.
*   **11010000138001**: voice verification code. You can call the [SingleCallByTts](https://help.aliyun.com/document_detail/393519.html) operation to send a voice verification code or a text-to-speech (TTS) voice notification to the specified number.
*   **11000000300005**: IVR. You can call the [IvrCall](https://help.aliyun.com/document_detail/393521.html) operation to initiate an interactive voice call to the specified number.
*   **11000000300009**: Session Initiation Protocol (SIP) call.
*   **11030000180001**: intelligent outbound call.

This parameter is required.', example='11000000300006'),
  queryDate?: long(name='QueryDate', description='The time at which call details are queried. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> The system queries the call records that are generated within 24 hours after the specified point in time. For example, if you specify the time 20:00:01 on November 21, 2022, the system queries the call records that are generated for the specified call ID from 20:00:01 on November 21, 2022, to 20:00:01 on November 22, 2022.

This parameter is required.', example='1671552000000'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryCallDetailByCallIdResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The details of the call, in the JSON format.

*   **caller**: the calling number.
*   **startDate**: the time when the call was started.
*   **stateDesc**: the description of the call state.
*   **duration**: the call duration. Unit: seconds. The value **0** indicates that the user was not connected.
*   **callerShowNumber**: the calling number displayed to the called party.
*   **gmtCreate**: the time when the call request was received.
*   **state**: the call state. The call state is returned by the Internet service provider (ISP) in real time. For more information about call states, see [ISP-returned error codes](https://help.aliyun.com/document_detail/55085.html).
*   **endDate**: the time when the call was ended.
*   **calleeShowNumber**: the number displayed to the called party.
*   **callee**: the called number.
*   **aRingTime**: the time when Line A started to ring, in the yyyy-MM-dd HH:mm:ss format.
*   **aEndTime**: the time when ringing on Line A ended, in the yyyy-MM-dd HH:mm:ss format.
*   **bRingTime**: the time when Line B started to ring, in the yyyy-MM-dd HH:mm:ss format.
*   **bEndTime**: the time when ringing on Line B ended, in the yyyy-MM-dd HH:mm:ss format.', example='{"caller":"18767****","startDate":"","stateDesc":"502","duration":0,"callerShowNumber":"05344****","gmtCreate":"2017-11-27 20:09:06","state":"502","endDate":"","calleeShowNumber":"053447****","bRingTime":"2022-01-01 12:02:00"，"bEndTime":"2022-01-01 12:02:28"，"callee":"1373546****"}'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
}

model QueryCallDetailByCallIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCallDetailByCallIdResponseBody(name='body'),
}

/**
 * @summary Queries the details of a call.
 *
 * @description QueryCallDetailByCallId is a common query operation. You can call this operation to query the details of a voice notification, voice verification code, interactive voice response (IVR), intelligent inbound voice call, intelligent outbound voice call, or intelligent robocall.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryCallDetailByCallIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryCallDetailByCallIdResponse
 */
async function queryCallDetailByCallIdWithOptions(request: QueryCallDetailByCallIdRequest, runtime: Util.RuntimeOptions): QueryCallDetailByCallIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.prodId)) {
    query['ProdId'] = request.prodId;
  }
  if (!Util.isUnset(request.queryDate)) {
    query['QueryDate'] = request.queryDate;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCallDetailByCallId',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a call.
 *
 * @description QueryCallDetailByCallId is a common query operation. You can call this operation to query the details of a voice notification, voice verification code, interactive voice response (IVR), intelligent inbound voice call, intelligent outbound voice call, or intelligent robocall.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryCallDetailByCallIdRequest
 * @return QueryCallDetailByCallIdResponse
 */
async function queryCallDetailByCallId(request: QueryCallDetailByCallIdRequest): QueryCallDetailByCallIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCallDetailByCallIdWithOptions(request, runtime);
}

model QueryCallDetailByTaskIdRequest {
  callee?: string(name='Callee', description='The called number. You can view the outbound call records of only one called number.

This parameter is required.', example='1390000****'),
  ownerId?: long(name='OwnerId'),
  queryDate?: long(name='QueryDate', description='The start time of the outbound robocall task. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='2020-10-09 09:02:03'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: string(name='TaskId', description='The unique ID of the outbound robocall task. The task ID is returned after the outbound robocall task is successfully delivered. You can view the task ID on the [Task Management](https://dyvms.console.aliyun.com/job/list) page of the Voice Messaging Service console, or call the **BatchRobotSmartCall** operation to obtain the **task ID**.

This parameter is required.', example='4001112222'),
}

model QueryCallDetailByTaskIdResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The call details of the outbound robocall task, in the JSON format.

*   **startDate**: the time when the call was answered.

*   **stateDesc**: the reason why the call was hung up. If the status code of early media was returned, this parameter indicates the reason why the status code of early media was used.

*   **statusCode**: the status code.

*   **EndDate**: the time when the call was ended.

*   **calleeShowNumber**: the calling number displayed to the called party.

*   **callee**: the called number.

*   **duration**: the billing duration.

*   **gmtCreate**: the time when the outbound robocall task was created.

*   **hangupDirection**: the party who hung up.

*   **tags**: the call tags.

*   **dialogCount**: the number of conversation rounds in the call.

*   **sureCount**: the number of times that the robocall task was acknowledged.

*   **denyCount**: the number of times that the robocall task was denied.

*   **rejectCount**: the number of times that the robocall task was rejected.

*   **customCount**: the number of times that the robocall task was customized.

*   **knowledgeCount**: the number of times that the knowledge base was queried.

*   **recordFile**: the download URL of the recording file. The URL is valid only for 48 hours. The recording file must be downloaded in time.

*   **callId**: the call ID.

*   **recordStatus**: indicates whether a recording file was available. Valid values:

    *   1: A recording file was available.
    *   2: No recording file was available.

*   **knowledgeCommonCount**: the number of call failures caused by the common issues in the knowledge base.

*   **knowledgeBusinessCount**: the number of call failures caused by the business issues in the knowledge base.

*   **callee**: the called number.

*   **dialogDetail**: the conversation details. The value is a JSON array that contains the following parameters:

    *   **role**: the role who spoke.
    *   **content**: the content of the speech.
    *   **time**: the start time of the speech.

> The preceding parameters are for reference only. The actually returned parameters prevail.', example='{"rejectCount":0,"dialogCount":3,"tags":"","startDate":"2019-03-27 10:34:54","gmtCreate":"2019-03-27 10:34:40","sureCount":0,"state":"200000","recordFile":"http://alicom-fc-record-biz.cn-hangzhou.oss.aliyun-inc.com/Freeswitch_RU_115987800002_02c3554f-ea24-422d-b1de-e671f455f21a_record.wav?OSSAccessKeyId=bypFNbGJVk73****&Signature=VWHOX%2FFhvvtSkxfMTw%2F5fdJUQuk%3D&Expires=1554382725","defaultCount":0,"endDate":"2019-03-27 10:35:09","calleeShowNumber":"1390000****","customCount":0,"callId":"1390000****","knowledgeCount":0,"recordStatus":1,"denyCount":0,"duration":16,"knowledgeCommonCount":0,"callee":"1390000****","knowledgeBusinessCount":0,"hangupDirection":1}'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D86B61A8-F2EE-4E4C-9F05-08A4676FFD89'),
}

model QueryCallDetailByTaskIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCallDetailByTaskIdResponseBody(name='body'),
}

/**
 * @summary Queries the call details of an outbound robocall task.
 *
 * @param request QueryCallDetailByTaskIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryCallDetailByTaskIdResponse
 */
async function queryCallDetailByTaskIdWithOptions(request: QueryCallDetailByTaskIdRequest, runtime: Util.RuntimeOptions): QueryCallDetailByTaskIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callee)) {
    query['Callee'] = request.callee;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.queryDate)) {
    query['QueryDate'] = request.queryDate;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCallDetailByTaskId',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the call details of an outbound robocall task.
 *
 * @param request QueryCallDetailByTaskIdRequest
 * @return QueryCallDetailByTaskIdResponse
 */
async function queryCallDetailByTaskId(request: QueryCallDetailByTaskIdRequest): QueryCallDetailByTaskIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCallDetailByTaskIdWithOptions(request, runtime);
}

model QueryCallInPoolTransferConfigRequest {
  ownerId?: long(name='OwnerId'),
  phoneNumber?: string(name='PhoneNumber', description='The China 400 number used to transfer the call.

This parameter is required.', example='400****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryCallInPoolTransferConfigResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: {
    calledRouteMode?: string(name='CalledRouteMode', description='The call mode. Valid values:

*   **roundRobin**
*   **random**', example='random'),
    details?: [ 
      {
        called?: string(name='Called', description='The number used to transfer the call.', example='400****'),
      }
    ](name='Details', description='The details of the response parameters.'),
    gmtCreate?: long(name='GmtCreate', description='The time when the call transfer task was created.', example='1623137002000'),
    transferTimeout?: string(name='TransferTimeout', description='The timeout period for transferring the call.', example='30'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='7BF47617-7851-48F7-A3A1-2021342A78E2'),
}

model QueryCallInPoolTransferConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCallInPoolTransferConfigResponseBody(name='body'),
}

/**
 * @summary Queries the configuration of the phone number used to transfer a call.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryCallInPoolTransferConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryCallInPoolTransferConfigResponse
 */
async function queryCallInPoolTransferConfigWithOptions(request: QueryCallInPoolTransferConfigRequest, runtime: Util.RuntimeOptions): QueryCallInPoolTransferConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCallInPoolTransferConfig',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configuration of the phone number used to transfer a call.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryCallInPoolTransferConfigRequest
 * @return QueryCallInPoolTransferConfigResponse
 */
async function queryCallInPoolTransferConfig(request: QueryCallInPoolTransferConfigRequest): QueryCallInPoolTransferConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCallInPoolTransferConfigWithOptions(request, runtime);
}

model QueryCallInTransferRecordRequest {
  callInCaller?: string(name='CallInCaller', description='The calling number of the inbound call.', example='150****0000'),
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', description='The page number. Default value: **1**.

This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: 1 to 10.

This parameter is required.', example='10'),
  phoneNumber?: string(name='PhoneNumber', description='The phone number to which a call is transferred.

This parameter is required.', example='400****'),
  queryDate?: string(name='QueryDate', description='The time at which call transfer records are queried, in the YYYY-MM-DD hh:mm:ss format.

> The query result is all the call transfer records of the specified day.

This parameter is required.', example='2021-06-28 00:00:00'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryCallInTransferRecordResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: {
    pageNo?: long(name='PageNo', description='The page number.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries per page.', example='20'),
    total?: long(name='Total', description='The total number of entries returned.', example='50'),
    values?: [ 
      {
        callInCalled?: string(name='CallInCalled', description='The called number of the inbound call.', example='150****0000'),
        callInCaller?: string(name='CallInCaller', description='The calling number of the inbound call.', example='150****0000'),
        gmtCreate?: long(name='GmtCreate', description='The time when the call was initiated.', example='2020-10-03 10:21:21'),
        recordUrl?: string(name='RecordUrl', description='The recording URL.', example='http://alicom-fc-media.cn-hangzhou.oss.aliyun-inc.com/dayuBizVoiceMrg/4238c230-9e74-41be-90b8-2fbe7684****.wav?Expires=1627538265&OSSAccessKeyId=bypFNbGJVk73****&Signature=****mUqkPqIQ%3D'),
        transferCalled?: string(name='TransferCalled', description='The phone number to which the call was transferred.', example='151****0000'),
        transferCaller?: string(name='TransferCaller', description='The calling number that transferred the call.', example='151****0000'),
      }
    ](name='Values', description='The call transfer records.'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='7BF47617-7851-48F7-A3A1-2021342A78E2'),
}

model QueryCallInTransferRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCallInTransferRecordResponseBody(name='body'),
}

/**
 * @summary Queries call transfer records.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryCallInTransferRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryCallInTransferRecordResponse
 */
async function queryCallInTransferRecordWithOptions(request: QueryCallInTransferRecordRequest, runtime: Util.RuntimeOptions): QueryCallInTransferRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callInCaller)) {
    query['CallInCaller'] = request.callInCaller;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.queryDate)) {
    query['QueryDate'] = request.queryDate;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCallInTransferRecord',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries call transfer records.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryCallInTransferRecordRequest
 * @return QueryCallInTransferRecordResponse
 */
async function queryCallInTransferRecord(request: QueryCallInTransferRecordRequest): QueryCallInTransferRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCallInTransferRecordWithOptions(request, runtime);
}

model QueryRobotInfoListRequest {
  auditStatus?: string(name='AuditStatus', description='The review state. Valid values:

*   **CONFIGURABLE**
*   **AUDITING**
*   **AUDITPASS**
*   **AUDITFAIL**', example='AUDITING'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryRobotInfoListResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The basic information about the robot, in the JSON format. The basic information contains the following parameters:

*   **id**: the robot ID.
*   **robotName**: the robot name.
*   **robotType**: the robot type.
*   **auditStatus**: the review state.
*   **gmtCreate**: the time when the task was created.
*   **gmtModified**: the time when the task was modified.
*   **partnerId**: the partner ID.
*   **asrId**: the ID of the automatic speech recognition (ASR) model.
*   **asrType**: the ASR type. Valid values: **Public** and **Private**.
*   **remark**: the additional information.', example='{["id":1000010920004, "gmtModified":"Thu Mar 21 15:38:55 CST 2019", "auditStatus":"AUDITPASS","gmtCreate":"Thu Mar 21 12:00:51 CST 2019","remark":"tset","partnerId":100000022670001,"asrId":"a9a1d69081fd4266ad788346bf5e1b6c","robotType":"CUSTOM","asrType":"1","robotName":"Collection scenario"},{"id":1000010920003,"gmtModified":"Thu Mar 21 11:51:10 CST 2019","auditStatus":"AUDITPASS","gmtCreate":"Thu Mar 21 11:44:57 CST 2019","remark":"test","partnerId":100000022670001,"asrId":"a9a1d69081fd4266ad788346bf5e1b6c","robotType":"CUSTOM","asrType":"1","robotName":"Collection scenario"]}'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='F59AF338-655D-48E8-9471-5EB07692B1CC'),
}

model QueryRobotInfoListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRobotInfoListResponseBody(name='body'),
}

/**
 * @summary Queries a list of robots.
 *
 * @param request QueryRobotInfoListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRobotInfoListResponse
 */
async function queryRobotInfoListWithOptions(request: QueryRobotInfoListRequest, runtime: Util.RuntimeOptions): QueryRobotInfoListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.auditStatus)) {
    query['AuditStatus'] = request.auditStatus;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRobotInfoList',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of robots.
 *
 * @param request QueryRobotInfoListRequest
 * @return QueryRobotInfoListResponse
 */
async function queryRobotInfoList(request: QueryRobotInfoListRequest): QueryRobotInfoListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRobotInfoListWithOptions(request, runtime);
}

model QueryRobotTaskCallDetailRequest {
  callee?: string(name='Callee', description='The called number.

This parameter is required.', example='130****0000'),
  ownerId?: long(name='OwnerId'),
  queryDate?: long(name='QueryDate', description='The timestamp of the time at which the call details you want to query.

This parameter is required.', example='2020-10-21 08:23:21'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='The unique ID of the robocall task. You can call the [CreateRobotTask](https://help.aliyun.com/document_detail/393531.html) operation to obtain the task ID.

This parameter is required.', example='1045001'),
}

model QueryRobotTaskCallDetailResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The call details of a robocall task, in the JSON format.

*   **taskId**: the unique ID of the robocall task.
*   **caller**: the calling number.
*   **called**: the called number.
*   **duration**: the call duration. Unit: seconds.
*   **label**: the label of the called party.
*   **dialogCount**: the number of conversation rounds in the call.
*   **callResult**: the call result.
*   **hangupDirection**: the party who hung up. Valid values: **0**: the robot. **1**: the called party.
*   **transferResult**: the result of transferring the call to an agent. Valid values: **1**, **0**, and **3**. The value 1 indicates that the call was transferred to the agent. The value 0 indicates that the call failed to be transferred to the agent. The value 3 indicates that the call was not transferred to the agent.
*   **transferNumber**: the phone number of the agent to whom the call was transferred.
*   **transferFailReason**: the reason why the call failed to be transferred to the agent.
*   **callId**: the unique receipt ID of the call, in the `taskId^bizId` format.
*   **recallCurTimes**: the number of recalls.
*   **callStartTime**: the start time of the call.
*   **callEndTime**: the end time of the call.
*   **sureCount**: the number of times that the robocall task was affirmed.
*   **denyCount**: the number of times that the robocall task was denied.
*   **rejectCount**: the number of times that the robocall task was rejected.
*   **customCount**: the number of times that the robocall task was customized.
*   **knowledgeCount**: the number of times that the knowledge base was queried.
*   **defaultCount**: the default number of calls.
*   **knowledgeBusinessCount**: the number of call failures caused by the business issues in the knowledge base.
*   **knowledgeCommonCount**: the number of call failures caused by the common issues in the knowledge base.
*   **recordStatus**: Indicates whether the call has a recording file. Valid values: **1**: The call has a recording file. **2**: The call does not have a recording file.
*   **recordFile**: the download URL of the recording file.
*   **dialogDetail**: the dialog details, in a JSON-formatted array. **role**: the object of the speech. **content**: the content of the speech. **speakTime**: the time of the speech.', example='{ "taskId" : 1045001, "caller" : "0571-8899****", "called" : "130****0000", "duration" : "60", "label" : "Invitation", "dialogCount": "3", "callResult" : "Not Available", "hangupDirection" : "1", "transferResult" : "3", "transferNumber" ：0571-8833****, "transferFailReason" ："User hangs up", "callId" ："116950320375^10375010****", "recallCurTimes" : 2, "callStartTime" : "2019.06.14 15:22:23", "callEndTime" : "2019.06.14 15:22:55", "sureCount" : 2, "denyCount" : 2, "rejectCount" : 0, "customCount" : 0, "knowledgeCount" : 0, "defaultCount" : 0, "knowledgeBusinessCount" : 0, "knowledgeCommonCount" : 0, "recordStatus":1, "recordFile": "http://alicom-fc-record-biz.cn-hangzhou.oss.aliyun-inc.com/Freeswitch_RU_117074080001_ccd71132-8256-4eb4-9217-884e1d87c0d4_record.wav?Expires=1562740186&OSSAccessKeyId=bypFNbGJVk7****&Signature=99losPmytVl%2BMH85noZGD******", "dialogDetail": [{"role": "robot","speakTime": "2019-06-19 20:44:17","content":"prologue"}] }'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model QueryRobotTaskCallDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRobotTaskCallDetailResponseBody(name='body'),
}

/**
 * @summary Queries the call details of a called number in a robocall task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotTaskCallDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRobotTaskCallDetailResponse
 */
async function queryRobotTaskCallDetailWithOptions(request: QueryRobotTaskCallDetailRequest, runtime: Util.RuntimeOptions): QueryRobotTaskCallDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callee)) {
    query['Callee'] = request.callee;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.queryDate)) {
    query['QueryDate'] = request.queryDate;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRobotTaskCallDetail',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the call details of a called number in a robocall task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotTaskCallDetailRequest
 * @return QueryRobotTaskCallDetailResponse
 */
async function queryRobotTaskCallDetail(request: QueryRobotTaskCallDetailRequest): QueryRobotTaskCallDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRobotTaskCallDetailWithOptions(request, runtime);
}

model QueryRobotTaskCallListRequest {
  callResult?: string(name='CallResult', description='The call result. Valid values:

*   **200002**: The line is busy.
*   **200005**: The called party cannot be connected.
*   **200010**: The phone of the called party is powered off.
*   **200011**: The called party is out of service.
*   **200012**: The call is lost.', example='200002'),
  called?: string(name='Called', description='The called number.', example='1300****0000'),
  dialogCountFrom?: string(name='DialogCountFrom', description='The minimum number of conversation rounds in the call.', example='0'),
  dialogCountTo?: string(name='DialogCountTo', description='The maximum number of conversation rounds in the call.', example='5'),
  durationFrom?: string(name='DurationFrom', description='The minimum call duration.', example='0'),
  durationTo?: string(name='DurationTo', description='The maximum call duration.', example='60'),
  hangupDirection?: string(name='HangupDirection', description='The party who hangs up. Valid values:

*   **0**: the called party.
*   **1**: the robot.', example='1'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='20'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: string(name='TaskId', description='The unique ID of the robocall task. You can call the [CreateRobotTask](https://help.aliyun.com/document_detail/393531.html) operation to obtain the task ID.

This parameter is required.', example='1045001****'),
}

model QueryRobotTaskCallListResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The information about the robocall task, which is a JSON-formatted array.

*   **taskId**: the unique ID of the robocall task.
*   **caller**: the calling number.
*   **called**: the called number.
*   **duration**: the call duration. Unit: seconds.
*   **label**: the label of the called party.
*   **dialogCount**: the number of conversation rounds in the call.
*   **callResult**: the call result.
*   **hangupDirection**: the party who hung up. Valid values: **1** and **0**. The value 1 indicates the called party, and the value 0 indicates the robot.
*   **transferResult**: the result of transferring the call to an agent. Valid values: **1**, **0**, and **3**. The value 1 indicates that the call was transferred to an agent. The value 0 indicates that the call failed to be transferred to an agent. The value 3 indicates that the call was not transferred to an agent.
*   **transferNumber**: the phone number of the agent to whom the call was transferred.
*   **transferFailReason**: the reason why the call failed to be transferred to an agent.
*   **callId**: the unique receipt ID of the call.
*   **recallCurTimes**: the number of recalls.
*   **callStartTime**: the start time of the call.
*   **callEndTime**: the end time of the call.
*   **sureCount**: the number of times that the robocall task was acknowledged.
*   **denyCount**: the number of times that the robocall task was denied.
*   **rejectCount**: the number of times that the robocall task was rejected.
*   **customCount**: the number of times that the robocall task was customized.
*   **knowledgeCount**: the number of times that the knowledge base was queried.
*   **defaultCount**: the default number of calls.
*   **knowledgeBusinessCount**: the number of call failures caused by the business issues in the knowledge base.
*   **knowledgeCommonCount**: the number of call failures caused by the common issues in the knowledge base.
*   ****', example='[ {"taskId":"1045001", "caller":"0571-889****", "called": "130****0000", "duration":"60", "label":"Invitation", "dialogCount":"3", "callResult":"Not Available", "hangupDirection":"1", "transferResult":"3", "transferNumber":"0571-8833****", "transferFailReason":"User hangs up", "callId":"116950320375^10375010****", "recallCurTimes":"2", "callStartTime":"2019.06.14 15:22:23", "callEndTime":"2019.06.14 15:22:55", "sureCount":"2", "denyCount":"2", "rejectCount":"0", "customCount:"0", "knowledgeCount":"0", "defaultCount":"0", "knowledgeBusinessCount":"0", "knowledgeCommonCount":"0"} ]'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model QueryRobotTaskCallListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRobotTaskCallListResponseBody(name='body'),
}

/**
 * @summary Queries the information about a robocall task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotTaskCallListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRobotTaskCallListResponse
 */
async function queryRobotTaskCallListWithOptions(request: QueryRobotTaskCallListRequest, runtime: Util.RuntimeOptions): QueryRobotTaskCallListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callResult)) {
    query['CallResult'] = request.callResult;
  }
  if (!Util.isUnset(request.called)) {
    query['Called'] = request.called;
  }
  if (!Util.isUnset(request.dialogCountFrom)) {
    query['DialogCountFrom'] = request.dialogCountFrom;
  }
  if (!Util.isUnset(request.dialogCountTo)) {
    query['DialogCountTo'] = request.dialogCountTo;
  }
  if (!Util.isUnset(request.durationFrom)) {
    query['DurationFrom'] = request.durationFrom;
  }
  if (!Util.isUnset(request.durationTo)) {
    query['DurationTo'] = request.durationTo;
  }
  if (!Util.isUnset(request.hangupDirection)) {
    query['HangupDirection'] = request.hangupDirection;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRobotTaskCallList',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a robocall task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotTaskCallListRequest
 * @return QueryRobotTaskCallListResponse
 */
async function queryRobotTaskCallList(request: QueryRobotTaskCallListRequest): QueryRobotTaskCallListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRobotTaskCallListWithOptions(request, runtime);
}

model QueryRobotTaskDetailRequest {
  id?: long(name='Id', description='The unique ID of the robocall task. You can call the [CreateRobotTask](~~CreateRobotTask~~) operation to obtain the task ID.

This parameter is required.', example='1045001'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryRobotTaskDetailResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The details of the robocall task, in the JSON format.

*   **Id**: the unique ID of the robocall task.
*   **taskName**: the task name.
*   **robotId**: the robot ID.
*   **robotName**: the robot name.
*   **corpName**: the company name.
*   **caller**: the number displayed to the called party.
*   **numberStatusIdent**: indicates whether number status identification was enabled. Valid values: **true** and **false**. The value true indicates that number status identification was enabled. The value false indicates that number status identification was not enabled.
*   **status**: the task state. You can call the [QueryRobotTaskList](~~QueryRobotTaskList~~) operation to obtain the task state from the `status` parameter.
*   **scheduleType**: the scheduling type. Valid values: **SINGLE** and **ORDER**. The value SINGLE indicates that the task was started immediately after it was created. The value ORDER indicates that the task was started at a scheduled time.
*   **retryType**: indicates whether auto-redial was enabled. Valid values: **1** and **0**. The value 1 indicates that auto-redial was enabled. The value 0 indicates that auto-redial was not enabled.
*   **recallStateCodes**: the call state in which redial is required. Valid values: **200010**, **200011**, **200002**, **200012**, and **200005**. The value 200010 indicates that the phone of the called party was powered off. The value 200011 indicates that the number of the called party was out of service. The value 200002 indicates that the line was busy. The value 200012 indicates that the call was lost. The value 200005 indicates that the called party could not be connected.
*   **recallTimes**: the number of redial times.
*   **recallInterval**: the redial interval. Unit: minutes.
*   **createTime**: the time when the task was created, in the yyyy-MM-dd HH:mm:ss format.
*   **fireTime**: the time when the task was started, in the yyyy-MM-dd HH:mm:ss format.
*   **completeTime**: the time when the task was completed, in the yyyy-MM-dd HH:mm:ss format.
*   **filename**: the name of the called number file.
*   **ossFilePath**: the path of the called number file.', example='{"id":1045001,"taskName":"Test Template","robotId":1000000075003,"robotName":"robot","corpName":"company ","caller":"057156xxxx,0571568xxxx", "numberStatusIdent":true,"status":"INIT","scheduleType":"SINGLE", "retryType":1,"recallStateCodes":"200010,200011", "recallTimes":2,"recallInterval":5,"createTime": "2019-06-14 11:04:19","fireTime":"2019-06-14 11:05:23","completeTime": "2019-06-14 18:21:06","called": [{"fileName": "5102636f-7be6-4a2d-9ac7-755a2e140a50--robotCallApi", "ossFilePath": "http://test.cn-hangzhou.oss.aliyun-inc.com/5102636f-7be6-4a2d-9ac7-755a2e140a50--robotCallApi.xlsx"}]}'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model QueryRobotTaskDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRobotTaskDetailResponseBody(name='body'),
}

/**
 * @summary Queries the details of a robocall task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotTaskDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRobotTaskDetailResponse
 */
async function queryRobotTaskDetailWithOptions(request: QueryRobotTaskDetailRequest, runtime: Util.RuntimeOptions): QueryRobotTaskDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRobotTaskDetail',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a robocall task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotTaskDetailRequest
 * @return QueryRobotTaskDetailResponse
 */
async function queryRobotTaskDetail(request: QueryRobotTaskDetailRequest): QueryRobotTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRobotTaskDetailWithOptions(request, runtime);
}

model QueryRobotTaskListRequest {
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='20'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', description='The task state. Valid values:

*   **INIT**: The task is not started.
*   **READY**: The task is ready to start.
*   **DISPATCH**: The task is being parsed.
*   **EXCUTING**: The task is being executed.
*   **MANUAL_STOP**: The task is manually suspended.
*   **SYSTEM_STOP**: The task is suspended by the system.
*   **ARREARS_STOP**: The task is suspended due to overdue payments.
*   **CANCEL**: The task is manually canceled.
*   **SYSTEM_CANCEL**: The task is canceled by the system.
*   **FINISH**: The task is complete.', example='EXCUTING'),
  taskName?: string(name='TaskName', description='The task name.', example='Test Template'),
  time?: string(name='Time', description='The date when the task is created, in the yyyy-MM-dd format.', example='2019-06-14'),
}

model QueryRobotTaskListResponseBody = {
  code?: string(name='Code', description='The response code.', example='OK'),
  data?: string(name='Data', description='The robocall tasks, in the JSON format.

*   **id**: the unique ID of the robocall task.
*   **taskName**: the task name.
*   **robotId**: the robot ID.
*   **robotName**: the robot name.
*   **status**: the task state.
*   **scheduleType**: the scheduling type. Valid values: **SINGLE** and **ORDER**. The value SINGLE indicates that the task was started immediately after it was created. The value ORDER indicates that the task was started at a scheduled time.
*   **createTime**: the time when the task was created, in the yyyy.MM.dd HH:mm:ss format.
*   **completeTime**: the time when the task was completed, in the yyyy.MM.dd HH:mm:ss format.
*   **fireTime**: the time when the task was started, in the yyyy.MM.dd HH:mm:ss format.
*   **totalCount**: the total number of calls processed.
*   **finishCount**: the number of calls completed.', example='[ {"id": 1045001, "taskName": "Test Template", "robotId": 1000000075003, "robotName": "robot", "status": "INIT","scheduleType": "SINGLE", "createTime": "2019.06.14 14:55:23", "completeTime": "2019.06.14 14:55:23", "fireTime": "2019.06.14 14:55:23", "totalCount": 1000, "finishCount": 998} ]'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  pageNo?: string(name='PageNo', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
  totalCount?: string(name='TotalCount', description='The total number of tasks.', example='1'),
}

model QueryRobotTaskListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRobotTaskListResponseBody(name='body'),
}

/**
 * @summary Queries the information about all robocall tasks.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotTaskListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRobotTaskListResponse
 */
async function queryRobotTaskListWithOptions(request: QueryRobotTaskListRequest, runtime: Util.RuntimeOptions): QueryRobotTaskListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.time)) {
    query['Time'] = request.time;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRobotTaskList',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about all robocall tasks.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotTaskListRequest
 * @return QueryRobotTaskListResponse
 */
async function queryRobotTaskList(request: QueryRobotTaskListRequest): QueryRobotTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRobotTaskListWithOptions(request, runtime);
}

model QueryRobotv2AllListRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryRobotv2AllListResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The information about the robot communication script, in the JSON format.

*   **id**: the ID of the robot communication script.
*   **robotName**: the name of the robot communication script.
*   **robotType**: the type of the robot communication script.', example='{"id":100000007****,"robotName":"Robot","robotType":"CUSTOM"}'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model QueryRobotv2AllListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRobotv2AllListResponseBody(name='body'),
}

/**
 * @summary Queries a list of robot communication scripts.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotv2AllListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRobotv2AllListResponse
 */
async function queryRobotv2AllListWithOptions(request: QueryRobotv2AllListRequest, runtime: Util.RuntimeOptions): QueryRobotv2AllListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRobotv2AllList',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of robot communication scripts.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryRobotv2AllListRequest
 * @return QueryRobotv2AllListResponse
 */
async function queryRobotv2AllList(request: QueryRobotv2AllListRequest): QueryRobotv2AllListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRobotv2AllListWithOptions(request, runtime);
}

model QueryVideoPlayProgressRequest {
  callId?: string(name='CallId', example='116004767703^102806****'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='159****0000'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryVideoPlayProgressResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='示例值示例值'),
  success?: boolean(name='Success', example='true'),
}

model QueryVideoPlayProgressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryVideoPlayProgressResponseBody(name='body'),
}

/**
 * @summary QueryVideoPlayProgress
 *
 * @param request QueryVideoPlayProgressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryVideoPlayProgressResponse
 */
async function queryVideoPlayProgressWithOptions(request: QueryVideoPlayProgressRequest, runtime: Util.RuntimeOptions): QueryVideoPlayProgressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryVideoPlayProgress',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary QueryVideoPlayProgress
 *
 * @param request QueryVideoPlayProgressRequest
 * @return QueryVideoPlayProgressResponse
 */
async function queryVideoPlayProgress(request: QueryVideoPlayProgressRequest): QueryVideoPlayProgressResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryVideoPlayProgressWithOptions(request, runtime);
}

model QueryVirtualNumberRequest {
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  prodCode?: string(name='ProdCode', description='The service name. Default value: **dyvms**.', example='dyvms'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routeType?: int32(name='RouteType', description='The route type. Valid values:

*   **0**: number location first.
*   **1**: random.', example='0'),
}

model QueryVirtualNumberResponseBody = {
  code?: string(name='Code', description='The response code. The value 200 indicates that the request was successful.', example='200'),
  data?: string(name='Data', description='The details of the numbers associated with the virtual numbers. The following fields are returned:

*   createTime: the time when the number was activated.
*   qualificationCount: the number of qualifications.
*   cityCount: the number of cities.
*   phoneNumCount: the number of virtual numbers.
*   remark: the additional information.
*   phoneNum: the virtual number.
*   routeType: the route type.
*   canCancel: indicates whether the number can be deactivated.
*   specCount: the number of Internet service providers (ISPs).
*   status: the number state. Valid values: **1**, **0**, and **-1**. The value 1 indicates that the number is valid. The value 0 indicates that the number is invalid. The value -1 indicates that the number was deactivated.
*   pageNo: the page number.
*   pageSize: the number of entries per page.
*   total: the total number of virtual numbers.', example='{"data":[{"createTime":"2020-07-15 04:00:00","qualificationCount":0,"cityCount":0,"phoneNumCount":1,"remark":"20200715Unicom CTD shut down","phoneNum":"05516214****","routeType":1,"canCancel":true,"specCount":0,"status":"1"}],"pageSize":1,"total":17,"pageNo":1}'),
  requestId?: string(name='RequestId', description='The request ID.', example='9FF70B74-1B3C-44C1-ACDF-8DF962988F0E'),
}

model QueryVirtualNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryVirtualNumberResponseBody(name='body'),
}

/**
 * @summary Queries a list of virtual numbers.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryVirtualNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryVirtualNumberResponse
 */
async function queryVirtualNumberWithOptions(request: QueryVirtualNumberRequest, runtime: Util.RuntimeOptions): QueryVirtualNumberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routeType)) {
    query['RouteType'] = request.routeType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryVirtualNumber',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of virtual numbers.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request QueryVirtualNumberRequest
 * @return QueryVirtualNumberResponse
 */
async function queryVirtualNumber(request: QueryVirtualNumberRequest): QueryVirtualNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryVirtualNumberWithOptions(request, runtime);
}

model QueryVirtualNumberRelationRequest {
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  phoneNum?: string(name='PhoneNum', description='The virtual number.', example='05516214****'),
  prodCode?: string(name='ProdCode', description='The service name. Default value: **dyvms**.', example='dyvms'),
  qualificationId?: long(name='QualificationId', description='The qualification ID.

You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Qualifications\\\\&Communication Scripts > Qualification Management**, and then click **Details** in the Actions column to view the qualification ID.', example='1000000542****'),
  regionNameCity?: string(name='RegionNameCity', description='The city to which the virtual number belongs.', example='hangzhou'),
  relatedNum?: string(name='RelatedNum', description='The real number.', example='1705559****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routeType?: int32(name='RouteType', description='The route type. Valid values:

**0**: number location first. **1**: random.', example='0'),
  specId?: long(name='SpecId', description='The number type. Valid values:

*   **1**: the number provided by a virtual network operator, in the 05710000\\\\*\\\\*\\\\*\\\\* format.
*   **2**: the number provided by an Internet service provider (ISP).
*   **3**: a 5-digit phone number that starts with 95.', example='1'),
}

model QueryVirtualNumberRelationResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value 200 indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='200'),
  data?: string(name='Data', description='The list of associations between virtual numbers and real numbers. The following fields are returned:

*   **relatedNum**: the real number.
*   **createTime**: the time when the number was activated.
*   **pageNo**: the page number.
*   **pageSize**: the number of entries per page.
*   **total**: the total number of entries returned.', example='{"data":[{"relatedNum":"1705559****","createTime":"2021-03-26 12:34:08"}],"pageSize":20,"total":1,"pageNo":1}'),
  requestId?: string(name='RequestId', description='The request ID.', example='8FAD5988-B483-48A4-B251-6E8470A67371'),
}

model QueryVirtualNumberRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryVirtualNumberRelationResponseBody(name='body'),
}

/**
 * @summary Queries a list of associations between virtual numbers and real numbers.
 *
 * @description ### QPS limits
 * You can call this operation up to 200 times per second per account.
 *
 * @param request QueryVirtualNumberRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryVirtualNumberRelationResponse
 */
async function queryVirtualNumberRelationWithOptions(request: QueryVirtualNumberRelationRequest, runtime: Util.RuntimeOptions): QueryVirtualNumberRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.phoneNum)) {
    query['PhoneNum'] = request.phoneNum;
  }
  if (!Util.isUnset(request.prodCode)) {
    query['ProdCode'] = request.prodCode;
  }
  if (!Util.isUnset(request.qualificationId)) {
    query['QualificationId'] = request.qualificationId;
  }
  if (!Util.isUnset(request.regionNameCity)) {
    query['RegionNameCity'] = request.regionNameCity;
  }
  if (!Util.isUnset(request.relatedNum)) {
    query['RelatedNum'] = request.relatedNum;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routeType)) {
    query['RouteType'] = request.routeType;
  }
  if (!Util.isUnset(request.specId)) {
    query['SpecId'] = request.specId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryVirtualNumberRelation',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of associations between virtual numbers and real numbers.
 *
 * @description ### QPS limits
 * You can call this operation up to 200 times per second per account.
 *
 * @param request QueryVirtualNumberRelationRequest
 * @return QueryVirtualNumberRelationResponse
 */
async function queryVirtualNumberRelation(request: QueryVirtualNumberRelationRequest): QueryVirtualNumberRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryVirtualNumberRelationWithOptions(request, runtime);
}

model QueryVoiceFileAuditInfoRequest {
  businessType?: int32(name='BusinessType', description='The type of the voice file. Valid values:

*   **0** (default): the voice notification file.
*   **2**: the recording file.', example='0'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  voiceCodes?: string(name='VoiceCodes', description='The ID of the voice file. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice Messages** > **Voice Notifications** or **Voice File Management**, and then click the **Voice Notification Files** tab to view the **voice ID**.

> You can query up to 10 voice files each time. Separate the voice file names with commas (,).

This parameter is required.', example='8501d2eb-efbb-471f-xxx8-****.wav'),
}

model QueryVoiceFileAuditInfoResponseBody = {
  code?: string(name='Code', description='The response code.

The value OK indicates that the request was successful. For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: [ 
    {
      auditState?: string(name='AuditState', description='The review state of the voice file. Valid values:

*   **AUDIT_STATE_INIT**: The voice file was under review.
*   **AUDIT_STATE_PASS**: The voice file was approved.
*   **AUDIT_STATE_NOT_PASS**: The voice file was rejected.
*   **AUDIT_STATE_UPLOADING**: The voice file was approved and is being uploaded.
*   **AUDIT_STATE_REDOING**: The voice file was being reprocessed.
*   **AUDIT_SATE_CANCEL**: The review of the voice file was canceled.
*   **AUDIT_PAUSE**: The review of the voice file was suspended.
*   **AUDIT_ORDER_FINISHED**: The voice file was approved by the ticket system and was waiting for the review of the Internet service provider (ISP).', example='AUDIT_STATE_NOT_PASS'),
      rejectInfo?: string(name='RejectInfo', description='The reason why the voice file was rejected.', example='This business is not supported'),
      voiceCode?: string(name='VoiceCode', description='The code of the voice file.', example='8501d2eb-efbb-471f-xxx8-****.wav'),
    }
  ](name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
}

model QueryVoiceFileAuditInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryVoiceFileAuditInfoResponseBody(name='body'),
}

/**
 * @summary Queries the review state of a voice file.
 *
 * @param request QueryVoiceFileAuditInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryVoiceFileAuditInfoResponse
 */
async function queryVoiceFileAuditInfoWithOptions(request: QueryVoiceFileAuditInfoRequest, runtime: Util.RuntimeOptions): QueryVoiceFileAuditInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.businessType)) {
    query['BusinessType'] = request.businessType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.voiceCodes)) {
    query['VoiceCodes'] = request.voiceCodes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryVoiceFileAuditInfo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the review state of a voice file.
 *
 * @param request QueryVoiceFileAuditInfoRequest
 * @return QueryVoiceFileAuditInfoResponse
 */
async function queryVoiceFileAuditInfo(request: QueryVoiceFileAuditInfoRequest): QueryVoiceFileAuditInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryVoiceFileAuditInfoWithOptions(request, runtime);
}

model RecoverCallInConfigRequest {
  number?: string(name='Number', description='The China 400 number that is used to transfer the inbound call.

This parameter is required.', example='400***'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model RecoverCallInConfigResponseBody = {
  code?: string(name='Code', description='The response code.', example='OK'),
  data?: boolean(name='Data', description='Indicates whether the inbound call was resumed. Valid values:

*   true: The inbound call was resumed.
*   false: The inbound call failed to be resumed.', example='true'),
  message?: string(name='Message', description='The returned message.', example='test'),
  requestId?: string(name='RequestId', description='The request ID.', example='a78278ff-26bb-48ec-805c-26a0f4c102***'),
}

model RecoverCallInConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RecoverCallInConfigResponseBody(name='body'),
}

/**
 * @summary Resumes the inbound call that is transferred by using a China 400 number.
 *
 * @param request RecoverCallInConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RecoverCallInConfigResponse
 */
async function recoverCallInConfigWithOptions(request: RecoverCallInConfigRequest, runtime: Util.RuntimeOptions): RecoverCallInConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.number)) {
    query['Number'] = request.number;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecoverCallInConfig',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Resumes the inbound call that is transferred by using a China 400 number.
 *
 * @param request RecoverCallInConfigRequest
 * @return RecoverCallInConfigResponse
 */
async function recoverCallInConfig(request: RecoverCallInConfigRequest): RecoverCallInConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return recoverCallInConfigWithOptions(request, runtime);
}

model ResumeVideoFileRequest {
  callId?: string(name='CallId', example='100001616500^1000018****'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ResumeVideoFileResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='示例值示例值'),
  success?: boolean(name='Success', example='True'),
}

model ResumeVideoFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResumeVideoFileResponseBody(name='body'),
}

/**
 * @summary ResumeVideoFile
 *
 * @param request ResumeVideoFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResumeVideoFileResponse
 */
async function resumeVideoFileWithOptions(request: ResumeVideoFileRequest, runtime: Util.RuntimeOptions): ResumeVideoFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResumeVideoFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary ResumeVideoFile
 *
 * @param request ResumeVideoFileRequest
 * @return ResumeVideoFileResponse
 */
async function resumeVideoFile(request: ResumeVideoFileRequest): ResumeVideoFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return resumeVideoFileWithOptions(request, runtime);
}

model SeekVideoFileRequest {
  callId?: string(name='CallId', description='呼叫唯一ID', example='示例值'),
  calledNumber?: string(name='CalledNumber', description='被叫号码', example='示例值示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  seekTimes?: long(name='SeekTimes', description='快进或快退值，负数为快退，单位秒', example='92'),
}

model SeekVideoFileResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='示例值'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='示例值示例值'),
  success?: boolean(name='Success', example='false'),
}

model SeekVideoFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SeekVideoFileResponseBody(name='body'),
}

/**
 * @summary SeekVideoFile
 *
 * @param request SeekVideoFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SeekVideoFileResponse
 */
async function seekVideoFileWithOptions(request: SeekVideoFileRequest, runtime: Util.RuntimeOptions): SeekVideoFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.seekTimes)) {
    query['SeekTimes'] = request.seekTimes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SeekVideoFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary SeekVideoFile
 *
 * @param request SeekVideoFileRequest
 * @return SeekVideoFileResponse
 */
async function seekVideoFile(request: SeekVideoFileRequest): SeekVideoFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return seekVideoFileWithOptions(request, runtime);
}

model SendVerificationRequest {
  bizType?: string(name='BizType', description='The business type. Set the value to **CONTACT**.

This parameter is required.', example='CONTACT'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  target?: string(name='Target', description='The mobile phone number that receives the SMS verification code.

This parameter is required.', example='150****0000'),
  verifyType?: string(name='VerifyType', description='The mode of sending the SMS verification code. Set the value to **SMS**.

This parameter is required.', example='SMS'),
}

model SendVerificationResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: boolean(name='Data', description='Indicates whether the verification code was sent successfully.', example='true'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='6086693B-2250-17CE-A41F-06259AB6DB1B'),
}

model SendVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendVerificationResponseBody(name='body'),
}

/**
 * @summary Sends an SMS verification code.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request SendVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendVerificationResponse
 */
async function sendVerificationWithOptions(request: SendVerificationRequest, runtime: Util.RuntimeOptions): SendVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.verifyType)) {
    query['VerifyType'] = request.verifyType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendVerification',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sends an SMS verification code.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request SendVerificationRequest
 * @return SendVerificationResponse
 */
async function sendVerification(request: SendVerificationRequest): SendVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendVerificationWithOptions(request, runtime);
}

model SetTransferCalleePoolConfigRequest {
  calledRouteMode?: string(name='CalledRouteMode', description='The call mode. Valid values:

*   **roundRobin**
*   **random**

This parameter is required.', example='roundRobin'),
  details?: [ 
    {
      called?: string(name='Called', description='The called number.

This parameter is required.', example='151****0000'),
      caller?: string(name='Caller', description='The calling number.', example='150****0000'),
    }
  ](name='Details', description='The information about the phone numbers for transferring the call.

This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  phoneNumber?: string(name='PhoneNumber', description='The phone number used for transferring the call.

This parameter is required.', example='400****'),
  qualificationId?: string(name='QualificationId', description='The qualification ID. You can call the [GetHotlineQualificationByOrder](https://help.aliyun.com/document_detail/393548.html) operation to obtain the qualification ID.

This parameter is required.', example='190***'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model SetTransferCalleePoolConfigResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: boolean(name='Data', description='Indicates whether the phone numbers for transferring the call were configured.', example='true'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='E7518CE1-B0FF-4C6F-9252-BF80271B2F99'),
}

model SetTransferCalleePoolConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetTransferCalleePoolConfigResponseBody(name='body'),
}

/**
 * @summary Sets the phone numbers for transferring a call.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request SetTransferCalleePoolConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetTransferCalleePoolConfigResponse
 */
async function setTransferCalleePoolConfigWithOptions(request: SetTransferCalleePoolConfigRequest, runtime: Util.RuntimeOptions): SetTransferCalleePoolConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledRouteMode)) {
    query['CalledRouteMode'] = request.calledRouteMode;
  }
  if (!Util.isUnset(request.details)) {
    query['Details'] = request.details;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.qualificationId)) {
    query['QualificationId'] = request.qualificationId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetTransferCalleePoolConfig',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sets the phone numbers for transferring a call.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request SetTransferCalleePoolConfigRequest
 * @return SetTransferCalleePoolConfigResponse
 */
async function setTransferCalleePoolConfig(request: SetTransferCalleePoolConfigRequest): SetTransferCalleePoolConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return setTransferCalleePoolConfigWithOptions(request, runtime);
}

model SingleCallByTtsRequest {
  calledNumber?: string(name='CalledNumber', description='The mobile phone number that receives voice notifications.

*   Number format in the Chinese mainland:

    *   Mobile phone number, for example, 159\\\\*\\\\*\\\\*\\\\*0000.
    *   Landline number, for example, 0571\\\\*\\\\*\\\\*\\\\*5678.

*   Number format outside the Chinese mainland: country code + phone number, for example, 85200\\\\*\\\\*\\\\*\\\\*00.

> 

*   Each request supports only one called number. For more information, see [How to use voice notifications in the Chinese mainland](https://help.aliyun.com/document_detail/150016.html) or [How to use voice verification codes in regions outside the Chinese mainland](https://help.aliyun.com/document_detail/270044.html).

*   Voice verification codes are sent to a called number at the following frequency: one time per minute, five times per hour, and 20 times per 24 hours.

This parameter is required.', example='1590****000'),
  calledShowNumber?: string(name='CalledShowNumber', description='The number displayed to the called party.

*   You do not need to specify this parameter if you use the text-to-speech (TTS) notification template or voice verification code template for outbound calls in the common mode. For more information, see [FAQ about the common outbound call mode](https://help.aliyun.com/document_detail/172104.html).
*   If you use the TTS notification template or voice verification code template for outbound calls in the dedicated mode, you must specify a number you purchased and only one number can be specified. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home) and choose **Voice Numbers** > **Real Number Management** to view the number you purchased.', example='0571****5678'),
  outId?: string(name='OutId', description='The custom ID that is reserved for the caller of the operation when the request is initiated. This ID is returned to the caller in a receipt message.

The value is of the STRING type and must be 1 to 15 bytes in length.', example='225869*****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: int32(name='PlayTimes', description='The number of times a voice notification is played back in a call. Valid values: 1 to 3. Default value: 3.', example='3'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  speed?: int32(name='Speed', description='The playback speed. Valid value: -500 to 500.', example='5'),
  ttsCode?: string(name='TtsCode', description='The ID of the approved TTS notification template or voice verification code template.

You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), and choose **Voice Messages** > **Voice Verification Codes** or choose **Voice Messages** > **Voice Notifications** to view the **template ID**.

> The account to which the TTS template belongs must be the same as the account that is used to call the SingleCallByTts operation.

This parameter is required.', example='TTS_100****'),
  ttsParam?: string(name='TtsParam', description='The variables in the template, in the JSON format.

> The variables in the template must be less than 250 characters in length. The length of each single variable is not limited. These variables do not support URLs. The variables in the verification code template support only digits and letters.', example='{"AckNum":"123456"}'),
  volume?: int32(name='Volume', description='The playback volume of the voice notification. Valid values: 0 to 100. Default value: 100.', example='100'),
}

model SingleCallByTtsResponseBody = {
  callId?: string(name='CallId', description='The unique receipt ID of the call.

You can call the [QueryCallDetailByCallId](https://help.aliyun.com/document_detail/393529.html) operation to query the details of the call based on the receipt ID.', example='116012354148^10281378****'),
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model SingleCallByTtsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SingleCallByTtsResponseBody(name='body'),
}

/**
 * @summary Sends a voice verification code or a voice notification with variables to a specified phone number.
 *
 * @description *   Due to business adjustments, the updates of the voice notification and voice verification code services have been stopped in regions outside the Chinese mainland and the services have been discontinued since March 2022. Only qualified customers can continue using the voice notification and voice verification code services.
 * *   For more information about voice plans or voice service billing, see [Pricing of VMS on China site (aliyun.com)](https://help.aliyun.com/document_detail/150083.html).
 * ### QPS limits
 * You can call this operation up to 1,000 times per second per account.
 *
 * @param request SingleCallByTtsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SingleCallByTtsResponse
 */
async function singleCallByTtsWithOptions(request: SingleCallByTtsRequest, runtime: Util.RuntimeOptions): SingleCallByTtsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.ttsCode)) {
    query['TtsCode'] = request.ttsCode;
  }
  if (!Util.isUnset(request.ttsParam)) {
    query['TtsParam'] = request.ttsParam;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SingleCallByTts',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sends a voice verification code or a voice notification with variables to a specified phone number.
 *
 * @description *   Due to business adjustments, the updates of the voice notification and voice verification code services have been stopped in regions outside the Chinese mainland and the services have been discontinued since March 2022. Only qualified customers can continue using the voice notification and voice verification code services.
 * *   For more information about voice plans or voice service billing, see [Pricing of VMS on China site (aliyun.com)](https://help.aliyun.com/document_detail/150083.html).
 * ### QPS limits
 * You can call this operation up to 1,000 times per second per account.
 *
 * @param request SingleCallByTtsRequest
 * @return SingleCallByTtsResponse
 */
async function singleCallByTts(request: SingleCallByTtsRequest): SingleCallByTtsResponse {
  var runtime = new Util.RuntimeOptions{};
  return singleCallByTtsWithOptions(request, runtime);
}

model SingleCallByVideoRequest {
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='1590****000'),
  calledShowNumber?: string(name='CalledShowNumber', example='0571****5678'),
  outId?: string(name='OutId', example='abcdefgh'),
  ownerId?: long(name='OwnerId'),
  playTimes?: int32(name='PlayTimes', example='3'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  speed?: int32(name='Speed', example='100'),
  videoCode?: string(name='VideoCode', description='This parameter is required.'),
  voiceCode?: string(name='VoiceCode', description='This parameter is required.', example='2d4c-4e78-8d2a-afbb06cf****.wav'),
  volume?: int32(name='Volume', example='100'),
}

model SingleCallByVideoResponseBody = {
  callId?: string(name='CallId', example='116012354148^10281378****'),
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='a78278ff-26bb-48ec-805c-26a0f4c102***'),
}

model SingleCallByVideoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SingleCallByVideoResponseBody(name='body'),
}

/**
 * @summary 语音视频单呼接口
 *
 * @param request SingleCallByVideoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SingleCallByVideoResponse
 */
async function singleCallByVideoWithOptions(request: SingleCallByVideoRequest, runtime: Util.RuntimeOptions): SingleCallByVideoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.videoCode)) {
    query['VideoCode'] = request.videoCode;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SingleCallByVideo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 语音视频单呼接口
 *
 * @param request SingleCallByVideoRequest
 * @return SingleCallByVideoResponse
 */
async function singleCallByVideo(request: SingleCallByVideoRequest): SingleCallByVideoResponse {
  var runtime = new Util.RuntimeOptions{};
  return singleCallByVideoWithOptions(request, runtime);
}

model SingleCallByVoiceRequest {
  calledNumber?: string(name='CalledNumber', description='The number for receiving voice notifications.

Number format:

*   In the Chinese mainland:

    *   Mobile phone number, for example, 159\\\\*\\\\*\\\\*\\\\*0000.
    *   Landline number, for example, 0571\\\\*\\\\*\\\\*\\\\*5678.

*   Outside the Chinese mainland: country code + phone number, for example, 85200\\\\*\\\\*\\\\*\\\\*00.

> 

*   You can specify only one called number for a request. For more information, see [How to use voice notifications in the Chinese mainland](https://help.aliyun.com/document_detail/150016.html) or [How to use voice notifications in regions outside the Chinese mainland](https://help.aliyun.com/document_detail/268810.html).

*   Voice notifications are sent to a called number at the following frequency: one time per minute, five times per hour, and 20 times per 24 hours.

This parameter is required.', example='1590****000'),
  calledShowNumber?: string(name='CalledShowNumber', description='The number displayed to the called party.

*   You do not need to specify this parameter if you use a voice notification file that uses the common outbound call mode. For more information, see [FAQ about the common outbound call mode](https://help.aliyun.com/document_detail/172104.html).
*   If you use a voice notification file that uses the dedicated outbound call mode, you must specify a number that you purchased. You can specify only one number. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home) and choose **Real Number Service** > **Real Number Management** to view the number that you purchased.', example='0571****5678'),
  outId?: string(name='OutId', description='The ID reserved for the caller. This ID is returned to the caller in a receipt message.

The value must be of the STRING type and 1 to 15 bytes in length.', example='22596****'),
  ownerId?: long(name='OwnerId'),
  playTimes?: int32(name='PlayTimes', description='The number of times the voice notification file is played. Valid values: 1 to 3.', example='3'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  speed?: int32(name='Speed', description='The playback speed of the voice notification file. Valid values: -500 to 500.', example='100'),
  voiceCode?: string(name='VoiceCode', description='The voice ID of the voice notification file.

You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice Messages** > **Voice Notifications** or **Voice File Management**, and then click the **Voice Notification Files** tab to view the **voice ID**.

This parameter is required.', example='2d4c-4e78-8d2a-afbb06cf****.wav'),
  volume?: int32(name='Volume', description='The playback volume of the voice notification file. Valid values: 0 to 100. Default value: 100.', example='100'),
}

model SingleCallByVoiceResponseBody = {
  callId?: string(name='CallId', description='The unique receipt ID for the call.

You can call the [QueryCallDetailByCallId](https://help.aliyun.com/document_detail/393529.html) operation to query the details of the call.', example='116004767703^102806****'),
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.****
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='E50FFA85-0B79-4421-A7BD-00B0A271966F'),
}

model SingleCallByVoiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SingleCallByVoiceResponseBody(name='body'),
}

/**
 * @summary Sends a voice notification to a phone number by using a voice notification file.
 *
 * @description > Due to business adjustments, the updates of the voice notification and voice verification code services have been stopped in regions outside the Chinese mainland and the services have been discontinued since March 2022. Only qualified customers can continue using the voice notification and voice verification code services.
 * You can call the [SingleCallByTts](https://help.aliyun.com/document_detail/393519.html) operation to send voice notifications with variables.
 * ### QPS limits
 * You can call this operation up to 1,200 times per second per account.
 *
 * @param request SingleCallByVoiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SingleCallByVoiceResponse
 */
async function singleCallByVoiceWithOptions(request: SingleCallByVoiceRequest, runtime: Util.RuntimeOptions): SingleCallByVoiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.playTimes)) {
    query['PlayTimes'] = request.playTimes;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SingleCallByVoice',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sends a voice notification to a phone number by using a voice notification file.
 *
 * @description > Due to business adjustments, the updates of the voice notification and voice verification code services have been stopped in regions outside the Chinese mainland and the services have been discontinued since March 2022. Only qualified customers can continue using the voice notification and voice verification code services.
 * You can call the [SingleCallByTts](https://help.aliyun.com/document_detail/393519.html) operation to send voice notifications with variables.
 * ### QPS limits
 * You can call this operation up to 1,200 times per second per account.
 *
 * @param request SingleCallByVoiceRequest
 * @return SingleCallByVoiceResponse
 */
async function singleCallByVoice(request: SingleCallByVoiceRequest): SingleCallByVoiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return singleCallByVoiceWithOptions(request, runtime);
}

model SkipVideoFileRequest {
  callId?: string(name='CallId', example='116012854210^10281427****'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='1590****000'),
  outId?: string(name='OutId', example='PR0210428****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  skipTimes?: long(name='SkipTimes', description='This parameter is required.', example='04:02:01'),
}

model SkipVideoFileResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: boolean(name='Data', example='false'),
  message?: string(name='Message', example='示例值示例值示例值'),
  success?: boolean(name='Success', example='true'),
}

model SkipVideoFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SkipVideoFileResponseBody(name='body'),
}

/**
 * @summary SkipVideoFile
 *
 * @param request SkipVideoFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SkipVideoFileResponse
 */
async function skipVideoFileWithOptions(request: SkipVideoFileRequest, runtime: Util.RuntimeOptions): SkipVideoFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.skipTimes)) {
    query['SkipTimes'] = request.skipTimes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SkipVideoFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary SkipVideoFile
 *
 * @param request SkipVideoFileRequest
 * @return SkipVideoFileResponse
 */
async function skipVideoFile(request: SkipVideoFileRequest): SkipVideoFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return skipVideoFileWithOptions(request, runtime);
}

model SmartCallRequest {
  actionCodeBreak?: boolean(name='ActionCodeBreak', description='Specifies whether the playback of the recording file can be interrupted. Default value: **true**. The default value indicates that the playback of the recording file can be interrupted.

If you set the value of this parameter to false, the playback of the recording file cannot be interrupted even if the value of action_break is set to true.

> The value of action_code_break takes precedence over the value of action_break.', example='true'),
  actionCodeTimeBreak?: int32(name='ActionCodeTimeBreak', description='The duration that the user keeps speaking. The playback of the recording file is interrupted when this duration is reached. Unit: milliseconds.

If the value of ActionCodeBreak is set to **true** for the recording file and the duration that the user keeps speaking reaches the specified duration, the playback of the recording file is interrupted. If you do not specify ActionCodeTimeBreak or set the value of ActionCodeTimeBreak to 0, the setting of ActionCodeBreak does not take effect.', example='120'),
  asrBaseId?: string(name='AsrBaseId', description='The ASR base model. Valid values:

*   **customer_service_8k** (default): Chinese Mandarin.
*   **dialect_customer_service_8k**: a heavy accent.

> You must specify the ASR model when you call the SmartCall operation. We recommend that you specify either of the AsrModelId and AsrBaseId parameters.

*   If you specify only the AsrModelId parameter, the specified ASR model is used.

*   If you specify only the AsrBaseId parameter, the ASR base model is used.

*   If you specify neither of the two parameters, the default ASR base model is used, that is, the default value customer_service_8k is used for the AsrBaseId parameter.

*   If you specify both parameters, make sure that their values do not conflict with each other.', example='customer_service_8k'),
  asrModelId?: string(name='AsrModelId', description='The ID of the Automatic Speech Recognition (ASR) model.

You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home) and view the ID of the ASR model on the **ASR Model Management** page.

> You must specify the ASR model when you call the SmartCall operation. We recommend that you specify either of the AsrModelId and AsrBaseId parameters.

*   If you specify only the AsrModelId parameter, the specified ASR model is used.

*   If you specify only the AsrBaseId parameter, the specified ASR base model is used.

*   If you specify neither of the two parameters, the default value customer_service_8k is used for the AsrBaseId parameter. This means that the default Mandarin ASR base model is used.

*   If you specify both parameters, make sure that their values do not conflict with each other.', example='2070aca1eff146f9a7bc826f1c3d****'),
  backgroundFileCode?: string(name='BackgroundFileCode', description='The ID of the background voice file that is played back when the user talks with the robot.

You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice File Management**, click the **Intelligent Speech Interaction Recording File** tab, and then click **Details** in the Actions column to view the voice ID.', example='2d4c-4e78-8d2a-afbb06cf****.wav'),
  backgroundSpeed?: int32(name='BackgroundSpeed', description='This parameter is unavailable.', example='1'),
  backgroundVolume?: int32(name='BackgroundVolume', description='This parameter is unavailable.', example='1'),
  calledNumber?: string(name='CalledNumber', description='The called number. Only phone numbers in the Chinese mainland are supported.

This parameter is required.', example='1590****0000'),
  calledShowNumber?: string(name='CalledShowNumber', description='The number displayed to the called party. The value must be the number you purchased.

You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home) and choose **Voice Numbers** > **Real Number Management** to view the number you purchased.

This parameter is required.', example='0571****5678'),
  dynamicId?: string(name='DynamicId', description='The dynamic extension ID that is reserved for the caller of the operation. This ID is returned in the callback URL and is used as the development identifier of the customer.', example='abcdefgh'),
  earlyMediaAsr?: boolean(name='EarlyMediaAsr', description='Specifies whether to enable speech recognition of early media. Valid values:

*   **false** (default): Speech recognition of early media is disabled.
*   **true**: Speech recognition of early media is enabled.

> If you set the value of this parameter to **true**, the reason why the call is not answered is recorded.', example='true'),
  enableITN?: boolean(name='EnableITN', description='Specifies whether to enable Inverse Text Normalization (ITN) during post-processing. Default value: **false**. If you set the value to false, ITN is not enabled during post-processing.

If you set the value to **true**, Chinese numerals are converted into Arabic numerals for output.', example='false'),
  muteTime?: int32(name='MuteTime', description='The silence duration. The system determines the end of the conversation based on the silence duration of the user. Unit: milliseconds. Valid values: 1000 to 20000.****

> 

*   If you specify a value out of the valid range, the default value **10000** is used.

*   The parameter value can be adjusted during the conversation. The last setting prevails.', example='10000'),
  noiseThreshold?: double(name='NoiseThreshold'),
  outId?: string(name='OutId', description='The ID that is reserved for the caller of the operation. This ID is returned to the caller in a receipt message.

The value is of the STRING type and must be 1 to 15 bytes in length.', example='342268*****'),
  ownerId?: long(name='OwnerId'),
  pauseTime?: int32(name='PauseTime', description='The pause duration. The system determines the end of a sentence based on the pause duration of the user in the conversation. Unit: milliseconds. Valid values: 300 to 1200.****

> 

*   If you specify a value out of the valid range, the default value **800** is used.

*   You cannot change the parameter value after specifying it.', example='800'),
  recordFlag?: boolean(name='RecordFlag', description='Specifies whether to record the conversation. Valid values:

*   **true**: The conversation is recorded.
*   **false**: The conversation is not recorded.', example='true'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sessionTimeout?: int32(name='SessionTimeout', description='The maximum call duration. The call is automatically hung up when the maximum call duration is reached. Unit: seconds.

> The maximum call duration is 3,600 seconds.', example='120'),
  speed?: int32(name='Speed', description='This parameter is unavailable.', example='1'),
  streamAsr?: int32(name='StreamAsr', description='Specifies whether to enable streaming ASR, which intelligently judges what the user wants to express based on the first few words spoken by the user. Valid values:

*   **0**: Streaming ASR is disabled.
*   **1**: Streaming ASR is enabled.', example='1'),
  ttsConf?: boolean(name='TtsConf', description='Specifies whether to set TTS sound parameters. Valid values:

*   **true**: TTS sound parameters must be set. You must set the **TtsStyle**, **TtsColume**, and **TtsSpeed** parameters to specify a sound style.
*   **false**: TTS sound parameters do not need to be set. The values of TTS sound parameters do not take effect even if you set them.', example='true'),
  ttsSpeed?: int32(name='TtsSpeed', description='The speed of TTS variable playback. Valid values: -200 to 200. Default value: 0.', example='100'),
  ttsStyle?: string(name='TtsStyle', description='The sound style for TTS variable playback. Default value: **xiaoyun**. For more information about the sound styles, see the **Sound styles** table below.', example='xiaoyun'),
  ttsVolume?: int32(name='TtsVolume', description='The volume of TTS variable playback. Valid values: 0 to 100. Default value: 0.', example='10'),
  voiceCode?: string(name='VoiceCode', description='The recording file that is played back in the intelligent outbound call.

The file can be an online file, a voice file uploaded from the Voice Messaging Service console, or a text-to-speech (TTS) template that contains variables. You can specify multiple files and a TTS variable together. Separate them with commas (,). The values of the variables in the TTS template are specified by the **VoiceCodeParam** parameter.

*   If you use an online file as the recording file, set the value of **VoiceCode** to the URL of the file that can be accessed over the Internet.
*   If you use a voice file uploaded from the Voice Messaging Service console as the recording file, set the value of **VoiceCode** to the voice ID of the file. You can log on to the [Voice Messaging Service console](https://dyvms.console.aliyun.com/overview/home), choose **Voice File Management**, click the **Intelligent Speech Interaction Recording File** tab, and then click **Details** in the Actions column to view the voice ID.
*   If you use a TTS template that contains variables as the recording file, set the value of **VoiceCode** to a variable name such as $name$, and also set a value for the variable in the **VoiceCodeParam** parameter.

This parameter is required.', example='2d4c-4e78-8d2a-afbb06cf****.wav,$name$'),
  voiceCodeParam?: string(name='VoiceCodeParam', description='The value of the TTS variable, in the JSON format. This value must match the TTS variable specified by the **VoiceCode** parameter.', example='{"name":"hello"}'),
  volume?: int32(name='Volume', description='The volume at which the recording file is played. Valid values: -4 to 4. We recommend that you set the value of this parameter to **1**.', example='1'),
}

model SmartCallResponseBody = {
  callId?: string(name='CallId', description='The unique receipt ID for this call.

You can call the [QueryCallDetailByCallId](~~QueryCallDetailByCallId~~) operation to query the details of the call based on the receipt ID.', example='116012854210^10281427****'),
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
}

model SmartCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SmartCallResponseBody(name='body'),
}

/**
 * @summary Initiates an intelligent voice call.
 *
 * @description *   The SmartCall operation must be used together with the [intelligent outbound HTTP operation](https://help.aliyun.com/document_detail/112703.html). After the call initiated by the Voice Messaging Service (VMS) platform is connected, the VMS platform sends the text converted from speech back to the business side, and the business side then returns the follow-up action to the VMS platform.
 * *   The SmartCall operation does not support the following characters: `@ = : "" $ { } ^ * ￥`.
 * ### QPS limits
 * You can call this operation up to 1,000 times per second per account.
 *
 * @param request SmartCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SmartCallResponse
 */
async function smartCallWithOptions(request: SmartCallRequest, runtime: Util.RuntimeOptions): SmartCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.actionCodeBreak)) {
    query['ActionCodeBreak'] = request.actionCodeBreak;
  }
  if (!Util.isUnset(request.actionCodeTimeBreak)) {
    query['ActionCodeTimeBreak'] = request.actionCodeTimeBreak;
  }
  if (!Util.isUnset(request.asrBaseId)) {
    query['AsrBaseId'] = request.asrBaseId;
  }
  if (!Util.isUnset(request.asrModelId)) {
    query['AsrModelId'] = request.asrModelId;
  }
  if (!Util.isUnset(request.backgroundFileCode)) {
    query['BackgroundFileCode'] = request.backgroundFileCode;
  }
  if (!Util.isUnset(request.backgroundSpeed)) {
    query['BackgroundSpeed'] = request.backgroundSpeed;
  }
  if (!Util.isUnset(request.backgroundVolume)) {
    query['BackgroundVolume'] = request.backgroundVolume;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.calledShowNumber)) {
    query['CalledShowNumber'] = request.calledShowNumber;
  }
  if (!Util.isUnset(request.dynamicId)) {
    query['DynamicId'] = request.dynamicId;
  }
  if (!Util.isUnset(request.earlyMediaAsr)) {
    query['EarlyMediaAsr'] = request.earlyMediaAsr;
  }
  if (!Util.isUnset(request.enableITN)) {
    query['EnableITN'] = request.enableITN;
  }
  if (!Util.isUnset(request.muteTime)) {
    query['MuteTime'] = request.muteTime;
  }
  if (!Util.isUnset(request.noiseThreshold)) {
    query['NoiseThreshold'] = request.noiseThreshold;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pauseTime)) {
    query['PauseTime'] = request.pauseTime;
  }
  if (!Util.isUnset(request.recordFlag)) {
    query['RecordFlag'] = request.recordFlag;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sessionTimeout)) {
    query['SessionTimeout'] = request.sessionTimeout;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  if (!Util.isUnset(request.streamAsr)) {
    query['StreamAsr'] = request.streamAsr;
  }
  if (!Util.isUnset(request.ttsConf)) {
    query['TtsConf'] = request.ttsConf;
  }
  if (!Util.isUnset(request.ttsSpeed)) {
    query['TtsSpeed'] = request.ttsSpeed;
  }
  if (!Util.isUnset(request.ttsStyle)) {
    query['TtsStyle'] = request.ttsStyle;
  }
  if (!Util.isUnset(request.ttsVolume)) {
    query['TtsVolume'] = request.ttsVolume;
  }
  if (!Util.isUnset(request.voiceCode)) {
    query['VoiceCode'] = request.voiceCode;
  }
  if (!Util.isUnset(request.voiceCodeParam)) {
    query['VoiceCodeParam'] = request.voiceCodeParam;
  }
  if (!Util.isUnset(request.volume)) {
    query['Volume'] = request.volume;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SmartCall',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Initiates an intelligent voice call.
 *
 * @description *   The SmartCall operation must be used together with the [intelligent outbound HTTP operation](https://help.aliyun.com/document_detail/112703.html). After the call initiated by the Voice Messaging Service (VMS) platform is connected, the VMS platform sends the text converted from speech back to the business side, and the business side then returns the follow-up action to the VMS platform.
 * *   The SmartCall operation does not support the following characters: `@ = : "" $ { } ^ * ￥`.
 * ### QPS limits
 * You can call this operation up to 1,000 times per second per account.
 *
 * @param request SmartCallRequest
 * @return SmartCallResponse
 */
async function smartCall(request: SmartCallRequest): SmartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return smartCallWithOptions(request, runtime);
}

model SmartCallOperateRequest {
  callId?: string(name='CallId', description='The unique receipt ID of the call. You can call the [SmartCall](https://help.aliyun.com/document_detail/393526.html) operation to obtain the receipt ID.

This parameter is required.', example='116012854210^1028142****'),
  command?: string(name='Command', description='The action that is initiated to the called number of an outbound robocall.

> Only the value **parallelBridge** is supported. This value indicates that a bridge action is initiated between a called number and an agent of the call center.

This parameter is required.', example='parallelBridge'),
  ownerId?: long(name='OwnerId'),
  param?: string(name='Param', description='The extended field.', example='Param'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model SmartCallOperateResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'),
  status?: boolean(name='Status', description='The action result. Valid values:

*   **true**: The action was successful.
*   **false**: The action failed.', example='true'),
}

model SmartCallOperateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SmartCallOperateResponseBody(name='body'),
}

/**
 * @summary Initiates an action in an outbound robocall. This operation is applicable only when the robocall is transferred to an agent or an agent is listening in on the conversation between the robot and the user.
 *
 * @description You can call this operation to initiate a specified action on the called number of an outbound robocall when the call is transferred to an agent of the call center.
 * > You can only initiate the action of bridging a called number and an agent of the call center.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request SmartCallOperateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SmartCallOperateResponse
 */
async function smartCallOperateWithOptions(request: SmartCallOperateRequest, runtime: Util.RuntimeOptions): SmartCallOperateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.command)) {
    query['Command'] = request.command;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.param)) {
    query['Param'] = request.param;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SmartCallOperate',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Initiates an action in an outbound robocall. This operation is applicable only when the robocall is transferred to an agent or an agent is listening in on the conversation between the robot and the user.
 *
 * @description You can call this operation to initiate a specified action on the called number of an outbound robocall when the call is transferred to an agent of the call center.
 * > You can only initiate the action of bridging a called number and an agent of the call center.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request SmartCallOperateRequest
 * @return SmartCallOperateResponse
 */
async function smartCallOperate(request: SmartCallOperateRequest): SmartCallOperateResponse {
  var runtime = new Util.RuntimeOptions{};
  return smartCallOperateWithOptions(request, runtime);
}

model StartRobotTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scheduleTime?: string(name='ScheduleTime', description='The time scheduled for starting the robocall task, in the yyyy-MM-dd HH:mm:ss format.', example='2019-06-14 14:55:23'),
  taskId?: long(name='TaskId', description='The unique ID of the robocall task. You can call the [CreateRobotTask](~~CreateRobotTask~~) operation to obtain the task ID.

This parameter is required.', example='104500****'),
}

model StartRobotTaskResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model StartRobotTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartRobotTaskResponseBody(name='body'),
}

/**
 * @summary Starts a robocall task immediately or at a scheduled time.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request StartRobotTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartRobotTaskResponse
 */
async function startRobotTaskWithOptions(request: StartRobotTaskRequest, runtime: Util.RuntimeOptions): StartRobotTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scheduleTime)) {
    query['ScheduleTime'] = request.scheduleTime;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartRobotTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Starts a robocall task immediately or at a scheduled time.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request StartRobotTaskRequest
 * @return StartRobotTaskResponse
 */
async function startRobotTask(request: StartRobotTaskRequest): StartRobotTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return startRobotTaskWithOptions(request, runtime);
}

model StopCallInConfigRequest {
  number?: string(name='Number', description='The China 400 number from which the inbound call to be stopped is transferred.

This parameter is required.', example='400***'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model StopCallInConfigResponseBody = {
  code?: string(name='Code', description='The response code.', example='OK'),
  data?: boolean(name='Data', description='Indicates whether the inbound call was stopped. Valid values:

*   true: The inbound call was stopped.
*   false: The inbound call failed to be stopped.', example='true'),
  message?: string(name='Message', description='The returned message.', example='test'),
  requestId?: string(name='RequestId', description='The request ID.', example='a78278ff-26bb-48ec-805c-26a0f4c102***'),
}

model StopCallInConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopCallInConfigResponseBody(name='body'),
}

/**
 * @summary Stops the inbound call that is transferred from a China 400 number.
 *
 * @param request StopCallInConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopCallInConfigResponse
 */
async function stopCallInConfigWithOptions(request: StopCallInConfigRequest, runtime: Util.RuntimeOptions): StopCallInConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.number)) {
    query['Number'] = request.number;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopCallInConfig',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Stops the inbound call that is transferred from a China 400 number.
 *
 * @param request StopCallInConfigRequest
 * @return StopCallInConfigResponse
 */
async function stopCallInConfig(request: StopCallInConfigRequest): StopCallInConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopCallInConfigWithOptions(request, runtime);
}

model StopRobotTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId', description='The unique ID of the robocall task. You can call the [CreateRobotTask](~~CreateRobotTask~~) operation to obtain the task ID.

This parameter is required.', example='1045001'),
}

model StopRobotTaskResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model StopRobotTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopRobotTaskResponseBody(name='body'),
}

/**
 * @summary Stops a robocall task that is in progress.
 *
 * @description After you stop a robocall task, you can call the [StartRobotTask](~~StartRobotTask~~) operation to start it again.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request StopRobotTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopRobotTaskResponse
 */
async function stopRobotTaskWithOptions(request: StopRobotTaskRequest, runtime: Util.RuntimeOptions): StopRobotTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopRobotTask',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Stops a robocall task that is in progress.
 *
 * @description After you stop a robocall task, you can call the [StartRobotTask](~~StartRobotTask~~) operation to start it again.
 * ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request StopRobotTaskRequest
 * @return StopRobotTaskResponse
 */
async function stopRobotTask(request: StopRobotTaskRequest): StopRobotTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopRobotTaskWithOptions(request, runtime);
}

model SubmitHotlineTransferRegisterRequest {
  agreement?: string(name='Agreement', description='The authenticity of the commitment. Valid values:

*   **true**: The commitment is authentic.
*   **false**: The commitment is not authentic.

This parameter is required.', example='true'),
  hotlineNumber?: string(name='HotlineNumber', description='The China 400 number.

This parameter is required.', example='400****'),
  operatorIdentityCard?: string(name='OperatorIdentityCard', description='The ID card number of the handler.

This parameter is required.', example='5****************9'),
  operatorMail?: string(name='OperatorMail', description='The email address of the handler.

This parameter is required.', example='username@example.com'),
  operatorMailVerifyCode?: string(name='OperatorMailVerifyCode', description='The verification code that is received by the mailbox of the handler.', example='1234'),
  operatorMobile?: string(name='OperatorMobile', description='The mobile phone number of the handler.

This parameter is required.', example='158****7230'),
  operatorMobileVerifyCode?: string(name='OperatorMobileVerifyCode', description='The verification code that is received by the mobile phone of the handler.

This parameter is required.', example='1234'),
  operatorName?: string(name='OperatorName', description='The name of the handler.

This parameter is required.', example='A***'),
  ownerId?: long(name='OwnerId'),
  qualificationId?: string(name='QualificationId', description='The qualification ID. You can call the [GetHotlineQualificationByOrder](https://help.aliyun.com/document_detail/393548.html) operation to obtain the qualification ID.

This parameter is required.', example='10000004933****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  transferPhoneNumberInfos?: [ 
    {
      identityCard?: string(name='IdentityCard', description='The ID card number of the number owner.

This parameter is required.', example='500***'),
      phoneNumber?: string(name='PhoneNumber', description='The China 400 number that you want to submit for registration.

This parameter is required.', example='1580000****'),
      phoneNumberOwnerName?: string(name='PhoneNumberOwnerName', description='The real name or company name of the number owner.

This parameter is required.', example='A***'),
    }
  ](name='TransferPhoneNumberInfos', description='The registration information about the China 400 number.

This parameter is required.'),
}

model SubmitHotlineTransferRegisterResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: long(name='Data', description='The registration ID.', example='2258****'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='6086693B-2250-17CE-A41F-06259AB6DB1B'),
}

model SubmitHotlineTransferRegisterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitHotlineTransferRegisterResponseBody(name='body'),
}

/**
 * @summary Submits a China 400 number for registration.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request SubmitHotlineTransferRegisterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitHotlineTransferRegisterResponse
 */
async function submitHotlineTransferRegisterWithOptions(request: SubmitHotlineTransferRegisterRequest, runtime: Util.RuntimeOptions): SubmitHotlineTransferRegisterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agreement)) {
    query['Agreement'] = request.agreement;
  }
  if (!Util.isUnset(request.hotlineNumber)) {
    query['HotlineNumber'] = request.hotlineNumber;
  }
  if (!Util.isUnset(request.operatorIdentityCard)) {
    query['OperatorIdentityCard'] = request.operatorIdentityCard;
  }
  if (!Util.isUnset(request.operatorMail)) {
    query['OperatorMail'] = request.operatorMail;
  }
  if (!Util.isUnset(request.operatorMailVerifyCode)) {
    query['OperatorMailVerifyCode'] = request.operatorMailVerifyCode;
  }
  if (!Util.isUnset(request.operatorMobile)) {
    query['OperatorMobile'] = request.operatorMobile;
  }
  if (!Util.isUnset(request.operatorMobileVerifyCode)) {
    query['OperatorMobileVerifyCode'] = request.operatorMobileVerifyCode;
  }
  if (!Util.isUnset(request.operatorName)) {
    query['OperatorName'] = request.operatorName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.qualificationId)) {
    query['QualificationId'] = request.qualificationId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.transferPhoneNumberInfos)) {
    query['TransferPhoneNumberInfos'] = request.transferPhoneNumberInfos;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitHotlineTransferRegister',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits a China 400 number for registration.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request SubmitHotlineTransferRegisterRequest
 * @return SubmitHotlineTransferRegisterResponse
 */
async function submitHotlineTransferRegister(request: SubmitHotlineTransferRegisterRequest): SubmitHotlineTransferRegisterResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitHotlineTransferRegisterWithOptions(request, runtime);
}

model UpgradeVideoFileRequest {
  callId?: string(name='CallId', example='116012354148^10281378****'),
  calledNumber?: string(name='CalledNumber', description='This parameter is required.', example='1590****000'),
  mediaType?: string(name='MediaType', example='video'),
  outId?: string(name='OutId', example='225869*****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UpgradeVideoFileResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: map[string]any(name='Data'),
  message?: string(name='Message', example='示例值示例值'),
  success?: boolean(name='Success', example='true'),
}

model UpgradeVideoFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeVideoFileResponseBody(name='body'),
}

/**
 * @summary UpgradeVideoFile
 *
 * @param request UpgradeVideoFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeVideoFileResponse
 */
async function upgradeVideoFileWithOptions(request: UpgradeVideoFileRequest, runtime: Util.RuntimeOptions): UpgradeVideoFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeVideoFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary UpgradeVideoFile
 *
 * @param request UpgradeVideoFileRequest
 * @return UpgradeVideoFileResponse
 */
async function upgradeVideoFile(request: UpgradeVideoFileRequest): UpgradeVideoFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeVideoFileWithOptions(request, runtime);
}

model UploadRobotTaskCalledFileRequest {
  calledNumber?: string(name='CalledNumber', description='The called numbers. Separate multiple called numbers with commas (,).

> After you create a robocall task, you must upload called numbers in batches. You can upload up to 300,000 called numbers for each task.

This parameter is required.', example='1370****000,1370****111'),
  id?: long(name='Id', description='The unique ID of the robocall task. You can call the [CreateRobotTask](~~CreateRobotTask~~) operation to obtain the ID of the robocall task.

This parameter is required.', example='1045****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ttsParam?: string(name='TtsParam', description='The values of the variable in the text-to-speech (TTS) template, in the JSON format. The variable values specified by the TtsParam parameter must match the variable names specified by the TtsParamHead parameter.

*   If all the called numbers carry the same variable values, you can set the value of the number field to **all** and upload only one copy of the variable values.
*   If only some of the called numbers carry the same variable values, you can set the value of the number field to **all** for these called numbers and set the value of the number field and variable values for other called numbers based on your business requirements. The system preferentially selects the values that you set for the called numbers.', example='[{"number":"1370****000","params":["xiaowang","xiaoli","xiaozhou"]}]'),
  ttsParamHead?: string(name='TtsParamHead', description='The list of variable names carried in the robocall task, in the JSON format. The TtsParamHead parameter must be used together with the TtsParam parameter.', example='["name1","name2","name3"]'),
}

model UploadRobotTaskCalledFileResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/112502.html).', example='OK'),
  data?: string(name='Data', description='The unique ID of the robocall task.

You can call the [QueryRobotTaskDetail](~~QueryRobotTaskDetail~~) operation to query the details of the robocall task based on the task ID.', example='10450****'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9CB3933-9FE3-4870-BA8E-2BEE91B69D23'),
}

model UploadRobotTaskCalledFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadRobotTaskCalledFileResponseBody(name='body'),
}

/**
 * @summary Uploads the called numbers of a robocall task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request UploadRobotTaskCalledFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UploadRobotTaskCalledFileResponse
 */
async function uploadRobotTaskCalledFileWithOptions(request: UploadRobotTaskCalledFileRequest, runtime: Util.RuntimeOptions): UploadRobotTaskCalledFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNumber)) {
    query['CalledNumber'] = request.calledNumber;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ttsParam)) {
    query['TtsParam'] = request.ttsParam;
  }
  if (!Util.isUnset(request.ttsParamHead)) {
    query['TtsParamHead'] = request.ttsParamHead;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UploadRobotTaskCalledFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Uploads the called numbers of a robocall task.
 *
 * @description ### QPS limits
 * You can call this operation up to 100 times per second per account.
 *
 * @param request UploadRobotTaskCalledFileRequest
 * @return UploadRobotTaskCalledFileResponse
 */
async function uploadRobotTaskCalledFile(request: UploadRobotTaskCalledFileRequest): UploadRobotTaskCalledFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return uploadRobotTaskCalledFileWithOptions(request, runtime);
}

